Skip to content

Commit e83b98d

Browse files
authored
Merge pull request #987 from infosiftr/repomd
Improve version update scraping; drop 5.7 on Debian (eol) and add 8.1 innovation on Oracle Linux
2 parents 2baf92d + c13cda9 commit e83b98d

File tree

8 files changed

+614
-119
lines changed

8 files changed

+614
-119
lines changed

5.7/Dockerfile.debian

Lines changed: 0 additions & 100 deletions
This file was deleted.

5.7/Dockerfile.oracle

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apply-templates.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ generated_warning() {
3232
for version; do
3333
export version
3434

35+
rm -f "$version"/Dockerfile.*
36+
3537
for variant in oracle debian; do
3638
export variant
3739

generate-stackbrew-library.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -Eeuo pipefail
33

44
declare -A aliases=(
55
[5.7]='5'
6-
[8.0]='8 latest'
6+
[innovation]='latest'
77
)
88

99
defaultDefaultVariant='oracle'
@@ -73,13 +73,15 @@ for version; do
7373
versionAliases+=( $fullVersion )
7474
fullVersion="${fullVersion%[.-]*}"
7575
done
76-
versionAliases+=(
77-
$version
78-
${aliases[$version]:-}
79-
)
76+
versionAliases+=( $fullVersion )
77+
if [ "$version" != "$fullVersion" ]; then
78+
versionAliases+=( $version )
79+
fi
80+
versionAliases+=( ${aliases[$version]:-} )
8081

8182
for variant in oracle debian; do
8283
df="Dockerfile.$variant"
84+
[ -s "$version/$df" ] || continue
8385
commit="$(dirCommit "$version" "$df")"
8486

8587
variantAliases=( "${versionAliases[@]/%/-$variant}" )

innovation/Dockerfile.oracle

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM oraclelinux:8-slim
8+
9+
RUN set -eux; \
10+
groupadd --system --gid 999 mysql; \
11+
useradd --system --uid 999 --gid 999 --home-dir /var/lib/mysql --no-create-home mysql
12+
13+
# add gosu for easy step-down from root
14+
# https://github.com/tianon/gosu/releases
15+
ENV GOSU_VERSION 1.16
16+
RUN set -eux; \
17+
# TODO find a better userspace architecture detection method than querying the kernel
18+
arch="$(uname -m)"; \
19+
case "$arch" in \
20+
aarch64) gosuArch='arm64' ;; \
21+
x86_64) gosuArch='amd64' ;; \
22+
*) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \
23+
esac; \
24+
curl -fL -o /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$gosuArch.asc"; \
25+
curl -fL -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$gosuArch"; \
26+
export GNUPGHOME="$(mktemp -d)"; \
27+
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
28+
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
29+
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
30+
chmod +x /usr/local/bin/gosu; \
31+
gosu --version; \
32+
gosu nobody true
33+
34+
RUN set -eux; \
35+
microdnf install -y \
36+
bzip2 \
37+
gzip \
38+
openssl \
39+
xz \
40+
zstd \
41+
# Oracle Linux 8+ is very slim :)
42+
findutils \
43+
; \
44+
microdnf clean all
45+
46+
RUN set -eux; \
47+
# https://dev.mysql.com/doc/refman/8.0/en/checking-gpg-signature.html
48+
# gpg: key 3A79BD29: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported
49+
key='859BE8D7C586F538430B19C2467B942D3A79BD29'; \
50+
export GNUPGHOME="$(mktemp -d)"; \
51+
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \
52+
gpg --batch --export --armor "$key" > /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql; \
53+
rm -rf "$GNUPGHOME"
54+
55+
ENV MYSQL_MAJOR innovation
56+
ENV MYSQL_VERSION 8.1.0-1.el8
57+
58+
RUN set -eu; \
59+
. /etc/os-release; \
60+
{ \
61+
echo '[mysqlinnovation-server-minimal]'; \
62+
echo 'name=MySQL innovation Server Minimal'; \
63+
echo 'enabled=1'; \
64+
echo "baseurl=https://repo.mysql.com/yum/mysql-innovation-community/docker/el/${VERSION_ID%%[.-]*}/\$basearch/"; \
65+
echo 'gpgcheck=1'; \
66+
echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
67+
# https://github.com/docker-library/mysql/pull/680#issuecomment-825930524
68+
echo 'module_hotfixes=true'; \
69+
} | tee /etc/yum.repos.d/mysql-community-minimal.repo
70+
71+
RUN set -eux; \
72+
microdnf install -y "mysql-community-server-minimal-$MYSQL_VERSION"; \
73+
microdnf clean all; \
74+
# the "socket" value in the Oracle packages is set to "/var/lib/mysql" which isn't a great place for the socket (we want it in "/var/run/mysqld" instead)
75+
# https://github.com/docker-library/mysql/pull/680#issuecomment-636121520
76+
grep -F 'socket=/var/lib/mysql/mysql.sock' /etc/my.cnf; \
77+
sed -i 's!^socket=.*!socket=/var/run/mysqld/mysqld.sock!' /etc/my.cnf; \
78+
grep -F 'socket=/var/run/mysqld/mysqld.sock' /etc/my.cnf; \
79+
{ echo '[client]'; echo 'socket=/var/run/mysqld/mysqld.sock'; } >> /etc/my.cnf; \
80+
\
81+
# make sure users dumping files in "/etc/mysql/conf.d" still works
82+
! grep -F '!includedir' /etc/my.cnf; \
83+
{ echo; echo '!includedir /etc/mysql/conf.d/'; } >> /etc/my.cnf; \
84+
mkdir -p /etc/mysql/conf.d; \
85+
# ensure these directories exist and have useful permissions
86+
# the rpm package has different opinions on the mode of `/var/run/mysqld`, so this needs to be after install
87+
mkdir -p /var/lib/mysql /var/run/mysqld; \
88+
chown mysql:mysql /var/lib/mysql /var/run/mysqld; \
89+
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
90+
chmod 1777 /var/lib/mysql /var/run/mysqld; \
91+
\
92+
mkdir /docker-entrypoint-initdb.d; \
93+
\
94+
mysqld --version; \
95+
mysql --version
96+
97+
RUN set -eu; \
98+
. /etc/os-release; \
99+
{ \
100+
echo '[mysql-tools-community]'; \
101+
echo 'name=MySQL Tools Community'; \
102+
echo "baseurl=https://repo.mysql.com/yum/mysql-tools-community/el/${VERSION_ID%%[.-]*}/\$basearch/"; \
103+
echo 'enabled=1'; \
104+
echo 'gpgcheck=1'; \
105+
echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
106+
# https://github.com/docker-library/mysql/pull/680#issuecomment-825930524
107+
echo 'module_hotfixes=true'; \
108+
} | tee /etc/yum.repos.d/mysql-community-tools.repo
109+
ENV MYSQL_SHELL_VERSION 8.0.34-1.el8
110+
RUN set -eux; \
111+
microdnf install -y "mysql-shell-$MYSQL_SHELL_VERSION"; \
112+
microdnf clean all; \
113+
\
114+
mysqlsh --version
115+
116+
VOLUME /var/lib/mysql
117+
118+
COPY docker-entrypoint.sh /usr/local/bin/
119+
ENTRYPOINT ["docker-entrypoint.sh"]
120+
121+
EXPOSE 3306 33060
122+
CMD ["mysqld"]

0 commit comments

Comments
 (0)