-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (44 loc) · 1.81 KB
/
Dockerfile
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
FROM rockylinux/rockylinux:9.4-minimal
# Ignore return value of microdnf as it seems to succeed but return a failure code on some hosts
RUN microdnf -y update || /bin/true
RUN microdnf -y install yum
RUN yum -y install epel-release
RUN dnf module enable -y nodejs:18
RUN yum -y --allowerasing install nodejs yum-utils rpmdevtools createrepo_c mock git golang \
jq make gcc-c++ rsync rkhunter coreutils file
RUN npm uninstall -g yarn pnpm && npm install -g corepack
RUN useradd builder -u 1000 -m -G users,wheel,mock && \
chmod 755 /home/builder
RUN \
corepack enable &&\
corepack prepare yarn@stable --activate
COPY ssm-9.tpl /etc/mock/templates/ssm-9.tpl
COPY ssm-9.cfg /etc/mock/ssm-9-.cfg
COPY centos-7.tpl /etc/mock/templates/centos-7.tpl
COPY centos-7-x86_64.cfg /etc/mock/centos-7-x86_64.cfg
RUN \
ARCH="$(rpm --eval "%{_arch}")" &&\
sed "s/_ARCH_/${ARCH}/g" /etc/mock/ssm-9-.cfg > "/etc/mock/ssm-9-${ARCH}.cfg" &&\
rm /etc/mock/ssm-9-.cfg &&\
sed -i 's/^mirrorlist=/#mirrorlist=/g' /etc/mock/templates/rocky-9.tpl &&\
sed -i 's/^#baseurl=/baseurl=/g' /etc/mock/templates/rocky-9.tpl
ENV GOPATH=/home/builder/go
RUN chown -R builder:builder /home/builder
#Configure build time caches
ENV npm_config_cache=/mnt/cache/npm
ENV GOCACHE=/mnt/cache/go
ENV YARN_CACHE_FOLDER=/mnt/cache/yarn
RUN mkdir -p "${npm_config_cache}"
RUN mkdir -p "${GOCACHE}"
RUN mkdir -p "${YARN_CACHE_FOLDER}"
RUN chown -R builder:builder /mnt/cache
RUN mkdir -p /mnt/tmp/mock && chown -R builder:builder /mnt/tmp/mock
VOLUME /mnt/cache
VOLUME /mnt/tmp
# Entrypoint runs as root to set up the system, then drops privs
USER root
COPY entrypoint /usr/local/sbin/entrypoint
RUN chmod 744 /usr/local/sbin/entrypoint
ENTRYPOINT ["/usr/local/sbin/entrypoint"]
ENV FLAVOR=rpmbuild OS=rockylinux DIST=el9 PATH=$PATH:${GOPATH}/bin
WORKDIR /home/builder