Skip to content

Commit

Permalink
Merge pull request #2 from libyui/fix-bitrot
Browse files Browse the repository at this point in the history
Fix build: repo renamed, Ruby ABI macro
  • Loading branch information
mvidner authored Feb 7, 2018
2 parents 7fcda69 + 14aacc5 commit 9c00b1e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
19 changes: 13 additions & 6 deletions Dockerfile.latest
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@
FROM opensuse:tumbleweed

# 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
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=`rpm --eval '%{rb_default_ruby_abi}'` && \
RUN RUBY_VERSION=ruby:`rpm --eval '%{rb_ver}'` && \
zypper --gpg-auto-import-keys --non-interactive in --no-recommends \
boost-devel \
cmake \
Expand Down
27 changes: 13 additions & 14 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
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 9c00b1e

Please sign in to comment.