Skip to content

Commit

Permalink
Adapt also the SLE12-SP3 image
Browse files Browse the repository at this point in the history
Import the expected GPG keys, avoid using blank cheque
"--gpg-auto-import-keys" option
  • Loading branch information
lslezak committed Feb 6, 2018
1 parent 43a0475 commit 32a5c26
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
15 changes: 11 additions & 4 deletions Dockerfile.latest
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@ FROM opensuse:tumbleweed
RUN zypper mr -d "NON OSS"

# "zypper dup" synchronizes with the current Tumbleweed (even downgrades if needed)
# to avoid possible dependency issues as the TW Docker image is updated less frequently
RUN zypper --gpg-auto-import-keys --non-interactive dup --no-recommends \
&& zypper clean -a
# to avoid possible dependency issues as the TW Docker image is updated less frequently,
# "curl" is needed for importing the GPG key by "rpm" command
RUN zypper --non-interactive dup --no-recommends \
&& zypper --non-interactive in --no-recommends curl && zypper clean -a

# add the YaST repository - we need the Rubocop gem for libyui/libyui-rake
RUN zypper ar -f http://download.opensuse.org/repositories/YaST:/Head/openSUSE_Tumbleweed/ yast

# import the YaST OBS GPG key
RUN rpm --import https://build.opensuse.org/projects/YaST/public_key

# prefer the packages from the libyui devel project
RUN zypper ar -f -p 50 http://download.opensuse.org/repositories/devel:/libraries:/libyui/openSUSE_Tumbleweed/ libyui

# import the libyui OBS GPG key
RUN rpm --import https://build.opensuse.org/projects/devel:libraries:libyui/public_key

# we need to install Ruby first to define the %{rb_default_ruby_abi} RPM macro
# see https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#run
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache
# why we need "zypper clean -a" at the end
RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \
RUN zypper --non-interactive in --no-recommends \
ruby && zypper clean -a

RUN RUBY_VERSION=ruby:`rpm --eval '%{rb_ver}'` && \
Expand Down
25 changes: 12 additions & 13 deletions Dockerfile.sle12-sp3
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,29 @@
# because of some licensing issues, use openSUSE-42.3 as a replacement.
# It shares the same core packages and should be close enough to SLE12-SP3
# for running the libyui builds.
# FIXME: for now use the TW base, 42.3 (beta) has not been published yet,
# after releasing 42.3 update this line to:
# FROM opensuse:42.3
FROM opensuse:tumbleweed
FROM opensuse:42.3

# the NON-OSS repo is not needed, save the network bandwidth and some time (~5 seconds) for each refresh
RUN zypper mr -d non-oss

# we need to install Ruby first to define the %{rb_default_ruby_abi} RPM macro
# see https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#run
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache
# why we need "zypper clean -a" at the end
# "curl" is needed for importing the GPG key by "rpm" command
RUN zypper --non-interactive in --no-recommends \
curl ruby && zypper clean -a

# Reuse the YaST SP3 repository, we do not want to maintain extra devel:libraries:libyui:SLE-12:SP3
# subproject.
#
# Set a higher priority for the sle_12_sp3 repo to prefer the packages from
# this repo even if they have a lower version than the original 42.3 packages.
# FIXME: use the TW build target for now, later switch to:
# RUN zypper ar -f -p 95 http://download.opensuse.org/repositories/YaST:/SLE-12:/SP3/SLE_12_SP3/ \
RUN zypper ar -f -p 95 http://download.opensuse.org/repositories/YaST:/SLE-12:/SP3/openSUSE_Tumbleweed/ \
RUN zypper ar -f -p 95 http://download.opensuse.org/repositories/YaST:/SLE-12:/SP3/SLE_12_SP3/ \
sle12_sp3

# we need to install Ruby first to define the %{rb_default_ruby_abi} RPM macro
# see https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#run
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache
# why we need "zypper clean -a" at the end
RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \
ruby && zypper clean -a
# import the YaST OBS GPG key
RUN rpm --import https://build.opensuse.org/projects/YaST:SLE-12:SP3/public_key

RUN RUBY_VERSION=`rpm --eval '%{rb_default_ruby_abi}'` && \
zypper --gpg-auto-import-keys --non-interactive in --no-recommends \
Expand Down

0 comments on commit 32a5c26

Please sign in to comment.