-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arm32 dockerfile (using template) #76
base: master
Are you sure you want to change the base?
Changes from all commits
ead47a9
204b125
0fe480e
3408efa
4f28c67
38be180
a8bd654
0e815bf
b2079e2
53380a1
0e63543
f71725b
d7f6486
4eafe0b
9d1b62a
e97d1c9
3489c2c
7b4fa8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# DO NOT EDIT THIS FILE - See Dockerfile.template | ||
|
||
FROM linuxserver/mariadb:arm32v7-110.3.16mariabionic-ls21 | ||
|
||
COPY bin/qpress-11-linux-arm32v6.tar /tmp/qpress.tar | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
curl \ | ||
netcat \ | ||
pigz \ | ||
percona-toolkit \ | ||
percona-xtrabackup \ | ||
pv \ | ||
gosu \ | ||
&& tar -C /usr/local/bin -xf /tmp/qpress.tar qpress \ | ||
&& chmod +x /usr/local/bin/qpress \ | ||
&& rm -rf /tmp/* /var/cache/apk/* /var/lib/apt/lists/* | ||
|
||
COPY conf.d/* /etc/mysql/conf.d/ | ||
COPY *.sh /usr/local/bin/ | ||
COPY bin/galera-healthcheck-arm32v6 /usr/local/bin/galera-healthcheck | ||
COPY primary-component.sql / | ||
|
||
# Fix permissions | ||
RUN chown -R mysql:mysql /etc/mysql && chmod -R go-w /etc/mysql | ||
RUN mkdir /var/run/mysqld && chown -R mysql:mysql /var/run/mysqld && chmod -R go-w /var/run/mysqld | ||
|
||
EXPOSE 3306 4444 4567 4567/udp 4568 8080 8081 | ||
|
||
HEALTHCHECK --retries=5 --start-period=30s CMD /usr/local/bin/healthcheck.sh | ||
|
||
ENV SST_METHOD=xtrabackup-v2 | ||
|
||
ENTRYPOINT ["start.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# DO NOT EDIT THIS FILE - See Dockerfile.template | ||
|
||
FROM __BASEIMAGE_ARCH__ | ||
|
||
COPY bin/qpress-11-linux-__DOCKER_ARCH__.tar /tmp/qpress.tar | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
curl \ | ||
netcat \ | ||
pigz \ | ||
percona-toolkit \ | ||
percona-xtrabackup \ | ||
pv \ | ||
gosu \ | ||
&& tar -C /usr/local/bin -xf /tmp/qpress.tar qpress \ | ||
&& chmod +x /usr/local/bin/qpress \ | ||
&& rm -rf /tmp/* /var/cache/apk/* /var/lib/apt/lists/* | ||
|
||
COPY conf.d/* /etc/mysql/conf.d/ | ||
COPY *.sh /usr/local/bin/ | ||
COPY bin/galera-healthcheck-__DOCKER_ARCH__ /usr/local/bin/galera-healthcheck | ||
COPY primary-component.sql / | ||
|
||
# Fix permissions | ||
RUN chown -R mysql:mysql /etc/mysql && chmod -R go-w /etc/mysql | ||
RUN mkdir /var/run/mysqld && chown -R mysql:mysql /var/run/mysqld && chmod -R go-w /var/run/mysqld | ||
|
||
EXPOSE 3306 4444 4567 4567/udp 4568 8080 8081 | ||
|
||
HEALTHCHECK --retries=5 --start-period=30s CMD /usr/local/bin/healthcheck.sh | ||
|
||
ENV SST_METHOD=__SST_METHOD__ | ||
|
||
ENTRYPOINT ["start.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
for mariadb_ver in "10.1" "10.2" "10.3"; do | ||
|
||
for docker_arch in "amd64" "arm32v6"; do | ||
|
||
# For arm we have only mariadb 10.1, at least for now | ||
if [ ${docker_arch} == "arm32v6" ] && [ ${mariadb_ver} != "10.1" ]; then | ||
break | ||
fi | ||
|
||
|
||
cp Dockerfile.template Dockerfile-${mariadb_ver}.${docker_arch} | ||
|
||
# Architecture-specific base image | ||
case ${docker_arch} in | ||
amd64 ) sed -i "s|__BASEIMAGE_ARCH__|mariadb:${mariadb_ver}|g" Dockerfile-${mariadb_ver}.${docker_arch} ;; | ||
arm32v6 ) sed -i "s|__BASEIMAGE_ARCH__|linuxserver/mariadb:arm32v7-110.3.16mariabionic-ls21|g" Dockerfile-${mariadb_ver}.${docker_arch} ;; | ||
esac | ||
|
||
# Architecture-specific binaries | ||
sed -i "s|__DOCKER_ARCH__|${docker_arch}|g" Dockerfile-${mariadb_ver}.${docker_arch} | ||
|
||
# SST method based on mariadb version | ||
if [ ${mariadb_ver} == "10.1" ]; then | ||
sed -i "s|__SST_METHOD__|xtrabackup-v2|g" Dockerfile-${mariadb_ver}.${docker_arch} | ||
else | ||
sed -i "s|__SST_METHOD__|mariabackup|g" Dockerfile-${mariadb_ver}.${docker_arch} | ||
fi | ||
|
||
done | ||
|
||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -355,5 +355,5 @@ fi | |
# Start mysqld | ||
echo "${LOG_MESSAGE} ---------------------------------------------------------------" | ||
echo "${LOG_MESSAGE} Starting with options: $OPT $START" | ||
exec mysqld $OPT $START | ||
exec mysqld $OPT $START --bind-address=0.0.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why this is needed, but I think it belongs in one of the .cnf files instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is already here: https://github.com/colinmollenhour/mariadb-galera-swarm/blob/master/conf.d/30-galera.cnf#L2 Are you overwriting this file locally, perhaps? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue I guess is that, at least in the jsurf image and linuxserver image, the bind-address setting gets overwritten by /etc/mysql/mariadb.conf.d/50-server.cnf file, with 127.0.0.1. The breakdown:
Out of those, only the
The first directory is the one the dockerfile populates, the second is presumably mariadb default. Grepping for the bind-address yields the following output:
As the I guess we should then overwrite the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I'd like to avoid making major changes to the config to avoid impacting existing users, so probably just resetting the environment from the jsurf image to match that of the official image would be the best soluition. E.g. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,4 +423,5 @@ test -s /var/run/galera-healthcheck-1.pid && kill $(cat /var/run/galera-healthch | |
test -s /var/run/galera-healthcheck-2.pid && kill $(cat /var/run/galera-healthcheck-2.pid) | ||
|
||
echo "Goodbye" | ||
cat /var/log/mysql/error.log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused as to why this is needed since it is supposed to be set up so that errors go to stderr which is of course captured by docker... Is there a local cnf file overriding the log path perhaps? I think this would be really confusing to see the full log after the "Goodbye" since it would not be chronologically correct, so if this does need to remain for some reason every line should be prefixed with something like: "=== post-shutdown - error.log:" so it is obvious where it is coming from. E.g. replace "cat" with:
|
||
exit $RC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also fork this file for amd64 vs armv6 because 128M is quite small for a machine without tiny disks so I'd like to keep the default for amd64 the same.