-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.sle12-sp5
76 lines (65 loc) · 2.75 KB
/
Dockerfile.sle12-sp5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# SLE12-SP5 is officially not available at the Docker Hub
# because of some licensing issues, use openSUSE-42.3 as a replacement
# as there is no openSUSE-42.5 release which would be the equivalent to SLES12-SP5.
# It shares the same core packages and should be close enough to SLE12-SP5
# for running the libyui builds.
FROM opensuse/leap:42.3
# ensure the UTF-8 locales are set
ENV LC_ALL=en_US.UTF-8
# do not install the files marked as documentation (use "rpm --excludedocs")
RUN sed -i -e "s/^.*rpm.install.excludedocs.*/rpm.install.excludedocs = yes/" /etc/zypp/zypp.conf
# 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 SP5 repository, we do not want to maintain extra devel:libraries:libyui:SLE-12:SP5
# subproject.
#
# Set a higher priority for the sle_12_sp5 repo to prefer the packages from
# this repo even if they have a lower version than the original 42.3 packages.
RUN zypper ar -f -p 95 https://download.opensuse.org/repositories/YaST:/SLE-12:/SP5/openSUSE_Leap_42.3/ \
sle12_sp5
# import the YaST OBS GPG key
RUN rpm --import https://build.opensuse.org/projects/YaST/public_key
RUN RUBY_VERSION=`rpm --eval '%{rb_default_ruby_abi}'` && \
zypper --non-interactive in --no-recommends \
boost-devel \
cmake \
doxygen \
fontconfig-devel \
gcc-c++ \
git \
gtk3-devel \
libyui-devel \
libyui-ncurses-devel \
libyui-qt-devel \
libzypp-devel \
obs-service-source_validator \
pkg-config \
'pkgconfig(Qt5Core)' \
'pkgconfig(Qt5Gui)' \
'pkgconfig(Qt5Svg)' \
'pkgconfig(Qt5Widgets)' \
'pkgconfig(Qt5X11Extras)' \
"rubygem($RUBY_VERSION:libyui-rake)" \
"rubygem($RUBY_VERSION:rubocop)" \
rpm-build \
yast2-devtools \
which \
&& zypper clean -a \
&& rm -rf /usr/lib*/ruby/gems/*/cache \
&& rm -rf /usr/share/doc/
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY libyui-travis /usr/local/bin
# run some smoke tests to make sure there is no serious issue with the image
RUN c++ --version
# this is a bit tricky as the libyui/rake loads some files at the initialization
RUN mkdir -p package && echo > package/test.spec && \
echo -e 'SET(VERSION_MAJOR "42")\nSET(VERSION_MINOR "42")\nSET(VERSION_PATCH "42")' \
> VERSION.cmake && rake -t -r libyui/rake -V && rm -rf package && rm VERSION.cmake