From 35b90084fed1f790832d58447cb7cea1251710bd Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 27 Jun 2022 14:19:44 -0700 Subject: [PATCH] Add --setopt=skip_missing_names_on_install=False to "yum install" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://unix.stackexchange.com/a/477127/153467 for details 🙈 --- 5.7/Dockerfile.oracle | 8 +++++--- template/Dockerfile.oracle | 26 ++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/5.7/Dockerfile.oracle b/5.7/Dockerfile.oracle index 4428e43a8..f1fb6ac5a 100644 --- a/5.7/Dockerfile.oracle +++ b/5.7/Dockerfile.oracle @@ -39,7 +39,9 @@ RUN set -eux; \ gosu nobody true RUN set -eux; \ - yum install -y \ +# https://github.com/docker-library/mysql/pull/871#issuecomment-1167954236 + yum install -y --setopt=skip_missing_names_on_install=False oracle-epel-release-el7; \ + yum install -y --setopt=skip_missing_names_on_install=False \ bzip2 \ gzip \ openssl \ @@ -74,7 +76,7 @@ RUN set -eu; \ } | tee /etc/yum.repos.d/mysql-community-minimal.repo RUN set -eux; \ - yum install -y "mysql-community-server-minimal-$MYSQL_VERSION"; \ + yum install -y --setopt=skip_missing_names_on_install=False "mysql-community-server-minimal-$MYSQL_VERSION"; \ yum 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 @@ -105,7 +107,7 @@ RUN set -eu; \ } | tee /etc/yum.repos.d/mysql-community-tools.repo ENV MYSQL_SHELL_VERSION 8.0.29-1.el7 RUN set -eux; \ - yum install -y "mysql-shell-$MYSQL_SHELL_VERSION"; \ + yum install -y --setopt=skip_missing_names_on_install=False "mysql-shell-$MYSQL_SHELL_VERSION"; \ yum clean all; \ \ mysqlsh --version diff --git a/template/Dockerfile.oracle b/template/Dockerfile.oracle index 8a0cbad7a..d71bf590a 100644 --- a/template/Dockerfile.oracle +++ b/template/Dockerfile.oracle @@ -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; \ @@ -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 \ @@ -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 @@ -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