|
| 1 | +# Keep Dockerfile.ubuntu the same as this file until all packaging |
| 2 | +# jobs are fixed to have a Dockerfile.ubuntu, and then the common |
| 3 | +# Jenkinsfile will be changed to use Dockerfile.ubuntu. |
1 | 4 | #
|
2 | 5 | # Copyright 2019-2021, Intel Corporation
|
| 6 | +# Copyright 2025 Hewlett Packard Enterprise Development LP |
3 | 7 | #
|
4 | 8 | # 'recipe' for Docker to build an Debian package
|
5 | 9 | #
|
6 | 10 | # Pull base image
|
7 |
| -FROM ubuntu:20.04 |
| 11 | +ARG BASE_DISTRO=ubuntu:20.04 |
| 12 | +FROM $BASE_DISTRO |
8 | 13 | LABEL org.opencontainers.image.authors=" [email protected]"
|
9 |
| - |
10 |
| -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
11 |
| - curl gpg |
| 14 | +# Needed for later use of BASE_DISTRO |
| 15 | +ARG BASE_DISTRO |
12 | 16 |
|
13 | 17 | ARG REPO_FILE_URL
|
14 |
| -RUN if [ -n "$REPO_FILE_URL" ]; then \ |
15 |
| - cd /etc/apt/sources.list.d && \ |
16 |
| - curl -f -o daos_ci-ubuntu20.04-artifactory.list.tmp \ |
17 |
| - "$REPO_FILE_URL"daos_ci-ubuntu20.04-artifactory.list && \ |
18 |
| - true > ../sources.list && \ |
19 |
| - mv daos_ci-ubuntu20.04-artifactory.list.tmp \ |
20 |
| - daos_ci-ubuntu20.04-artifactory.list; \ |
21 |
| - url="${REPO_FILE_URL%/*/}/hpe-ilorest-ubuntu-bionic-proxy/"; \ |
22 |
| - else \ |
23 |
| - url="https://downloads.linux.hpe.com/SDR/repo/ilorest/"; \ |
24 |
| - fi; \ |
25 |
| - cd -; \ |
26 |
| - mkdir -p /usr/local/share/keyrings/; \ |
27 |
| - curl -f -O "$url"GPG-KEY-hprest; \ |
28 |
| - gpg --no-default-keyring --keyring ./temp-keyring.gpg \ |
29 |
| - --import GPG-KEY-hprest; \ |
30 |
| - gpg --no-default-keyring --keyring ./temp-keyring.gpg --export \ |
31 |
| - --output /usr/local/share/keyrings/hpe-sdr-public.gpg; \ |
32 |
| - rm ./temp-keyring.gpg; \ |
33 |
| - curl -f -O "$REPO_FILE_URL"esad_repo.key; \ |
34 |
| - gpg --no-default-keyring --keyring ./temp-keyring.gpg \ |
35 |
| - --import esad_repo.key; \ |
36 |
| - gpg --no-default-keyring --keyring ./temp-keyring.gpg --export \ |
37 |
| - --output /usr/local/share/keyrings/daos-stack-public.gpg |
| 18 | +ARG DAOS_LAB_CA_FILE_URL |
| 19 | +ARG REPOSITORY_NAME |
| 20 | +# script to setup local repo if available |
| 21 | +COPY ./packaging/scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh |
| 22 | + |
| 23 | +RUN chmod +x /tmp/repo-helper.sh && \ |
| 24 | + /tmp/repo-helper.sh && \ |
| 25 | + rm -f /tmp/repo-helper.sh |
38 | 26 |
|
39 |
| -# Install basic tools |
| 27 | +# Install basic tools - rpmdevtools temporary commented out. |
40 | 28 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
41 | 29 | autoconf bash ca-certificates curl debhelper dh-make \
|
42 | 30 | dpkg-dev dh-python doxygen gcc git git-buildpackage \
|
43 | 31 | javahelper locales make patch pbuilder pkg-config \
|
44 |
| - python3-dev python3-distro python3-distutils rpm scons wget \ |
45 |
| - cmake valgrind rpmdevtools |
| 32 | + python3-dev python3-distro python3-distutils rpm scons sudo \ |
| 33 | + wget cmake valgrind # rpmdevtools |
46 | 34 |
|
47 | 35 | # use same UID as host and default value of 1000 if not specified
|
48 | 36 | ARG UID=1000
|
49 | 37 |
|
50 | 38 | # Add build user (to keep chrootbuild happy)
|
51 |
| -ENV USER build |
| 39 | +ENV USER=build |
52 | 40 | RUN useradd -u $UID -ms /bin/bash $USER
|
53 | 41 |
|
54 | 42 | # need to run the build command as root, as it needs to chroot
|
55 | 43 | RUN if ! grep "^#includedir /etc/sudoers.d" /etc/sudoers; then \
|
56 | 44 | echo "#includedir /etc/sudoers.d" >> /etc/sudoers; \
|
57 | 45 | fi; \
|
58 | 46 | echo "Defaults env_keep += \"DPKG_GENSYMBOLS_CHECK_LEVEL\"" > /etc/sudoers.d/build; \
|
59 |
| - echo "build ALL=(ALL) NOPASSWD: /usr/bin/tee /root/.pbuilderrc" >> /etc/sudoers.d/build; \ |
| 47 | + echo "build ALL=(ALL) NOPASSWD: /usr/bin/tee /root/.pbuilderrc" >> /etc/sudoers.d/build; \ |
60 | 48 | echo "build ALL=(ALL) NOPASSWD: /usr/sbin/pbuilder" >> /etc/sudoers.d/build; \
|
61 | 49 | chmod 0440 /etc/sudoers.d/build; \
|
62 | 50 | visudo -c; \
|
|
0 commit comments