Skip to content

Commit

Permalink
Add --setopt=skip_missing_names_on_install=False to "yum install"
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Jun 27, 2022
1 parent 8720110 commit 35b9008
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
8 changes: 5 additions & 3 deletions 5.7/Dockerfile.oracle

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions template/Dockerfile.oracle
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{{ def dnf: if .oracle.variant | startswith("7") then "yum" else "microdnf" end -}}
{{
def dnf:
if .oracle.variant | startswith("7") then
"yum"
else
"microdnf"
end
;
def dnf_install:
dnf + " install -y"
| if . == "yum install -y" then
# --setopt=skip_missing_names_on_install=False: https://unix.stackexchange.com/a/477127/153467
. + " --setopt=skip_missing_names_on_install=False"
else . end
-}}
FROM oraclelinux:{{ .oracle.variant }}

RUN set -eux; \
Expand Down Expand Up @@ -34,7 +48,11 @@ RUN set -eux; \
gosu nobody true

RUN set -eux; \
{{ dnf }} install -y \
{{ if .oracle.variant | startswith("7") then ( -}}
# https://github.com/docker-library/mysql/pull/871#issuecomment-1167954236
{{ dnf_install }} oracle-epel-release-el7; \
{{ ) else "" end -}}
{{ dnf_install }} \
bzip2 \
gzip \
openssl \
Expand Down Expand Up @@ -73,7 +91,7 @@ RUN set -eu; \
} | tee /etc/yum.repos.d/mysql-community-minimal.repo

RUN set -eux; \
{{ dnf }} install -y "mysql-community-server-minimal-$MYSQL_VERSION"; \
{{ dnf_install }} "mysql-community-server-minimal-$MYSQL_VERSION"; \
{{ dnf }} clean all; \
# 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)
# https://github.com/docker-library/mysql/pull/680#issuecomment-636121520
Expand Down Expand Up @@ -104,7 +122,7 @@ RUN set -eu; \
} | tee /etc/yum.repos.d/mysql-community-tools.repo
ENV MYSQL_SHELL_VERSION {{ .["mysql-shell"].version }}
RUN set -eux; \
{{ dnf }} install -y "mysql-shell-$MYSQL_SHELL_VERSION"; \
{{ dnf_install }} "mysql-shell-$MYSQL_SHELL_VERSION"; \
{{ dnf }} clean all; \
\
mysqlsh --version
Expand Down

0 comments on commit 35b9008

Please sign in to comment.