|
1 |
| -{{ def dnf: if .oracle.variant | startswith("7") then "yum" else "microdnf" end -}} |
| 1 | +{{ |
| 2 | + def dnf: |
| 3 | + if .oracle.variant | startswith("7") then |
| 4 | + "yum" |
| 5 | + else |
| 6 | + "microdnf" |
| 7 | + end |
| 8 | + ; |
| 9 | + def dnf_install: |
| 10 | + dnf + " install -y" |
| 11 | + | if . == "yum install -y" then |
| 12 | + # --setopt=skip_missing_names_on_install=False: https://unix.stackexchange.com/a/477127/153467 |
| 13 | + . + " --setopt=skip_missing_names_on_install=False" |
| 14 | + else . end |
| 15 | +-}} |
2 | 16 | FROM oraclelinux:{{ .oracle.variant }}
|
3 | 17 |
|
4 | 18 | RUN set -eux; \
|
@@ -34,7 +48,11 @@ RUN set -eux; \
|
34 | 48 | gosu nobody true
|
35 | 49 |
|
36 | 50 | RUN set -eux; \
|
37 |
| - {{ dnf }} install -y \ |
| 51 | +{{ if .oracle.variant | startswith("7") then ( -}} |
| 52 | +# https://github.com/docker-library/mysql/pull/871#issuecomment-1167954236 |
| 53 | + {{ dnf_install }} oracle-epel-release-el7; \ |
| 54 | +{{ ) else "" end -}} |
| 55 | + {{ dnf_install }} \ |
38 | 56 | bzip2 \
|
39 | 57 | gzip \
|
40 | 58 | openssl \
|
@@ -73,7 +91,7 @@ RUN set -eu; \
|
73 | 91 | } | tee /etc/yum.repos.d/mysql-community-minimal.repo
|
74 | 92 |
|
75 | 93 | RUN set -eux; \
|
76 |
| - {{ dnf }} install -y "mysql-community-server-minimal-$MYSQL_VERSION"; \ |
| 94 | + {{ dnf_install }} "mysql-community-server-minimal-$MYSQL_VERSION"; \ |
77 | 95 | {{ dnf }} clean all; \
|
78 | 96 | # 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)
|
79 | 97 | # https://github.com/docker-library/mysql/pull/680#issuecomment-636121520
|
@@ -104,7 +122,7 @@ RUN set -eu; \
|
104 | 122 | } | tee /etc/yum.repos.d/mysql-community-tools.repo
|
105 | 123 | ENV MYSQL_SHELL_VERSION {{ .["mysql-shell"].version }}
|
106 | 124 | RUN set -eux; \
|
107 |
| - {{ dnf }} install -y "mysql-shell-$MYSQL_SHELL_VERSION"; \ |
| 125 | + {{ dnf_install }} "mysql-shell-$MYSQL_SHELL_VERSION"; \ |
108 | 126 | {{ dnf }} clean all; \
|
109 | 127 | \
|
110 | 128 | mysqlsh --version
|
|
0 commit comments