-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.mockbuild
More file actions
79 lines (69 loc) · 3.25 KB
/
Dockerfile.mockbuild
File metadata and controls
79 lines (69 loc) · 3.25 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
78
79
#
# Copyright 2018-2024 Intel Corporation
# Copyright 2025 Hewlett Packard Enterprise Development LP
#
# 'recipe' for Docker to build an RPM
#
# Pull base image
ARG FVERSION=latest
FROM fedora:$FVERSION
# Needed for later use of FVERSION
ARG FVERSION
LABEL maintainer="daos@daos.groups.io"
# Use local repo server if present
ARG REPO_FILE_URL
ARG DAOS_LAB_CA_FILE_URL
ARG REPOSITORY_NAME
# script to install OS updates basic tools and daos dependencies
# COPY ./utils/scripts/install-fedora.sh /tmp/install.sh
# script to setup local repo if available
COPY ./packaging/scripts/repo-helper-fedora.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
RUN dnf -y install mock make \
rpm-build createrepo rpmlint git \
python-srpm-macros rpmdevtools && \
dnf -y clean all
# use same UID as host and default value of 1000 if not specified
ARG UID=1000
# Add build user (to keep rpmbuild happy)
ENV USER=build
ENV PASSWD=build
# add the user to the mock group so it can run mock
RUN if [ $UID != 0 ]; then \
useradd -u $UID -ms /bin/bash $USER; \
echo "$USER:$PASSWD" | chpasswd; \
usermod -a -G mock $USER; \
mkdir -p /var/cache/mock; \
chown $USER:root /var/cache/mock; \
fi
ARG CB0
RUN dnf -y upgrade && \
dnf clean all
# Monkey-patch rpmlint until a new release is made with
# https://github.com/rpm-software-management/rpmlint/pull/795 in it
# But make sure to patch after dnf upgrade so that an upgraded rpmlint
# RPM doesn't wipe out our patch
# Ditto for the patch to zero and display ccache stats
# https://github.com/rpm-software-management/mock/pull/1299
ARG PACKAGINGDIR=packaging
COPY ${PACKAGINGDIR}/*.patch ./
RUN (cd $(python3 -c 'import site; print(site.getsitepackages()[-1])') && \
if ! grep -e --ignore-unused-rpmlintrc rpmlint/cli.py; then \
if ! patch -p1 < $OLDPWD/rpmlint--ignore-unused-rpmlintrc.patch; then \
exit 1; \
fi; \
rm -f rpmlint/__pycache__/{cli,lint}.*.pyc; \
fi; \
if ! grep _ccachePostBuildHook mockbuild/plugins/ccache.py; then \
if ! patch -p3 < $OLDPWD/ccache-stats.patch; then \
exit 1; \
fi; \
rm -f mockbuild/plugins/__pycache__/ccache.*.pyc; \
fi); \
rm -f rpmlint--ignore-unused-rpmlintrc.patch ccache-stats.patch
# show the release that was built
ARG CACHEBUST
RUN cat /etc/os-release