-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
46 lines (34 loc) · 1.18 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
# syntax = docker/dockerfile:experimental
# IMPORTANT: build it this way to allow for privileged execution
#
# Docker daemon config should have the entitlement
# ```json
# { "builder": {"Entitlements": {"security-insecure": true }} }
# ```
# ```
# DOCKER_BUILDKIT=1 docker build --allow security.insecure -t pgpm:local /path/to/pgpm
# ```
FROM fedora:41 AS pgpm
RUN dnf -y install rpmlint ruby ruby-devel mock git gcc zlib-devel libyaml-devel
# Pre-initialize mock roots
COPY lib/pgpm/rpm/mock/configs configs
RUN --security=insecure for file in $(find configs -name '*.cfg'); do for ver in "17 16 15 14 13"; \
do mock --config-opts pgdg_version=$ver $file --init ; done; done
# Pre-initialize gems. It may need an update later, but it'll save us time
RUN mkdir -p /pgpm
COPY lib /pgpm/lib
COPY Gemfile /pgpm
COPY pgpm.gemspec /pgpm
COPY exe /pgpm/exe
RUN chmod +x /pgpm/exe/*
RUN cd /pgpm && gem build && gem install -n /usr/local/bin pgpm*.gem
RUN rm -rf pgpm
COPY containers.conf /etc/containers/containers.conf
RUN rm -rf /run/containers/storage /run/libpod
ENV QEMU_CPU max
FROM pgpm AS pgpm-dev
COPY . /pgpm
RUN cd /pgpm && bundle install
RUN rm -rf /pgpm
VOLUME /pgpm
WORKDIR /pgpm