-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.ubuntu.20.04
More file actions
77 lines (69 loc) · 3.35 KB
/
Dockerfile.ubuntu.20.04
File metadata and controls
77 lines (69 loc) · 3.35 KB
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
77
# Keep Dockerfile.ubuntu the same as this file until all packaging
# jobs are fixed to have a Dockerfile.ubuntu, and then the common
# Jenkinsfile will be changed to use Dockerfile.ubuntu.
#
# Copyright 2019-2021, Intel Corporation
# Copyright 2025-2026 Hewlett Packard Enterprise Development LP
#
# 'recipe' for Docker to build an Debian package
#
# Pull base image
ARG BASE_DISTRO=ubuntu:20.04
FROM $BASE_DISTRO
LABEL org.opencontainers.image.authors="daos@daos.groups.io"
# Needed for later use of BASE_DISTRO
ARG BASE_DISTRO
# Accept DAOS_HTTP_PROXY, DAOS_HTTPS_PROXY, and DAOS_NO_PROXY at build time
ARG DAOS_NO_PROXY
ARG DAOS_HTTP_PROXY
ARG DAOS_HTTPS_PROXY
# Propagate into the build environment
ENV http_proxy=${DAOS_HTTP_PROXY} \
HTTP_PROXY=${DAOS_HTTP_PROXY} \
https_proxy=${DAOS_HTTPS_PROXY} \
HTTPS_PROXY=${DAOS_HTTPS_PROXY} \
no_proxy=${DAOS_NO_PROXY} \
NO_PROXY=${DAOS_NO_PROXY}
# Persist into /etc/environment for use by shells and services
RUN set -e; \
if [ -n "$DAOS_HTTP_PROXY" ]; then \
echo "http_proxy=$DAOS_HTTP_PROXY" >> /etc/environment; \
echo "HTTP_PROXY=$DAOS_HTTP_PROXY" >> /etc/environment; \
fi; \
if [ -n "$DAOS_HTTPS_PROXY" ]; then \
echo "https_proxy=$DAOS_HTTPS_PROXY" >> /etc/environment; \
echo "HTTPS_PROXY=$DAOS_HTTPS_PROXY" >> /etc/environment; \
fi; \
if [ -n "$DAOS_NO_PROXY" ]; then \
echo "no_proxy=$DAOS_NO_PROXY" >> /etc/environment; \
echo "NO_PROXY=$DAOS_NO_PROXY" >> /etc/environment; \
fi
ARG REPO_FILE_URL
ARG DAOS_LAB_CA_FILE_URL
ARG REPOSITORY_NAME
# Script to setup a local repo instead of the distro-provided one.
# Only takes effect when REPO_FILE_URL is set; otherwise it is a no-op.
RUN --mount=type=bind,source=packaging/scripts/repo-helper-ubuntu.sh,target=/tmp/repo-helper-ubuntu.sh \
/tmp/repo-helper-ubuntu.sh
# Install basic tools - rpmdevtools temporary commented out.
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
autoconf bash ca-certificates curl debhelper dh-make \
dpkg-dev dh-python doxygen gcc git git-buildpackage \
javahelper locales make patch pbuilder pkg-config \
python3-dev python3-distro python3-distutils rpm scons sudo \
wget cmake valgrind # rpmdevtools
# use same UID as host and default value of 1000 if not specified
ARG UID=1000
# Add build user (to keep chrootbuild happy)
ENV USER=build
RUN useradd -u $UID -ms /bin/bash $USER
# need to run the build command as root, as it needs to chroot
RUN if ! grep "^#includedir /etc/sudoers.d" /etc/sudoers; then \
echo "#includedir /etc/sudoers.d" >> /etc/sudoers; \
fi; \
echo "Defaults env_keep += \"DPKG_GENSYMBOLS_CHECK_LEVEL\"" > /etc/sudoers.d/build; \
echo "build ALL=(ALL) NOPASSWD: /usr/bin/tee /root/.pbuilderrc" >> /etc/sudoers.d/build; \
echo "build ALL=(ALL) NOPASSWD: /usr/sbin/pbuilder" >> /etc/sudoers.d/build; \
chmod 0440 /etc/sudoers.d/build; \
visudo -c; \
sudo -l -U build