-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ubuntu.20.04
More file actions
51 lines (45 loc) · 2.33 KB
/
Dockerfile.ubuntu.20.04
File metadata and controls
51 lines (45 loc) · 2.33 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
# 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 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
ARG REPO_FILE_URL
ARG DAOS_LAB_CA_FILE_URL
ARG REPOSITORY_NAME
# script to setup local repo if available
COPY ./packaging/scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh
RUN chmod +x /tmp/repo-helper.sh && \
/tmp/repo-helper.sh && \
rm -f /tmp/repo-helper.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