File tree 5 files changed +54
-4
lines changed
5 files changed +54
-4
lines changed Original file line number Diff line number Diff line change
1
+ # syntax = docker/dockerfile:experimental
2
+
3
+ # IMPORTANT: build it this way to allow for privileged execution
4
+ #
5
+ # Docker daemon config should have the entitlement
6
+ # ```json
7
+ # { "builder": {"Entitlements": {"security-insecure": true }} }
8
+ # ```
9
+ # ```
10
+ # DOCKER_BUILDKIT=1 docker build --allow security.insecure -t IMAGE_NAME /path/to/pgpm
11
+ # ```
12
+
13
+ # This Dockerfile is used to build a Debian image, which includes pbuilder and
14
+ # pbuilder chroot image with basic dependendencies needed for building most
15
+ # packages already pre-installed.
16
+
17
+ FROM docker.io/library/debian
18
+
19
+ MAINTAINER PGPM Debian Maintainer
[email protected]
20
+
21
+ VOLUME /proc
22
+ ARG DEBIAN_FRONTEND=noninteractive
23
+ RUN apt update
24
+ RUN apt install -y build-essential pbuilder fakeroot fakechroot
25
+ RUN echo 'MIRRORSITE=http://deb.debian.org/debian' > /etc/pbuilderrc
26
+ RUN echo 'AUTO_DEBSIGN=${AUTO_DEBSIGN:-no}' > /root/.pbuilderrc
27
+ RUN echo 'HOOKDIR=/var/cache/pbuilder/hooks' >> /root/.pbuilderrc
28
+ RUN --security=insecure pbuilder create # --components "main contrib-non-free"
29
+
30
+ COPY pbuilder_install_script.sh /root/pbuilder_install_script.sh
31
+ RUN --security=insecure pbuilder execute --save-after-exec /root/pbuilder_install_script.sh
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def run_build
61
61
# podman run options
62
62
create_opts = " -v #{ @pgpm_dir } :/root/pgpm"
63
63
create_opts += ":z" if selinux_enabled?
64
- create_opts += " --privileged"
64
+ create_opts += " --privileged --tmpfs /tmp" #--privileged --cap-add=sys_admin --security-opt label:disable -v /proc:/proc
65
65
create_opts += " --name #{ @container_name } #{ image_name } "
66
66
67
67
dsc_fn = "#{ @spec . package . name } -#{ @spec . package . version . to_s } _0-1.dsc"
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ apt update
3
+ DEBIAN_FRONTEND=noninteractive apt -y install build-essential curl lsb-release ca-certificates
4
+
5
+ # ## PostgreSQL installation
6
+ #
7
+ install -d /usr/share/postgresql-common/pgdg
8
+ curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
9
+
10
+ # Create the repository configuration file:
11
+ sh -c ' echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
12
+
13
+ # Update the package lists:
14
+ apt update
15
+
16
+ # Install the latest version of PostgreSQL:
17
+ # If you want a specific version, use 'postgresql-16' or similar instead of 'postgresql'
18
+ apt -y install postgresql-17 postgresql-server-dev-17 postgresql-common
19
+ #
20
+ # ## END OF PostgreSQL installation
21
+
Original file line number Diff line number Diff line change 2
2
3
3
* Version <%= source_version %> package release.
4
4
5
- -- PGPM Debian maintainer <debian .maintainer@postgres.pm > <%= Time . now . to_s %>
5
+ -- PGPM Debian maintainer <debian .maintainer@pgpm.org > <%= Time . now . strftime ( '%a, %d %b %Y %H:%M:%S %z' ) %>
Original file line number Diff line number Diff line change @@ -10,15 +10,13 @@ def build_dependencies
10
10
case @os
11
11
when "debian" , "ubuntu"
12
12
[
13
- "postgresql-#{ postgres_major_version } " ,
14
13
"build-essential" ,
15
14
"postgresql-#{ postgres_major_version } " ,
16
15
"postgresql-server-dev-#{ postgres_major_version } " ,
17
16
"postgresql-common"
18
17
]
19
18
when "rocky" , "redhat" , "fedora"
20
19
[
21
- "postgresql-#{ postgres_major_version } " ,
22
20
"build-essential" ,
23
21
"postgresql-#{ postgres_major_version } " ,
24
22
"postgresql-server-devel-#{ postgres_major_version } " ,
You can’t perform that action at this time.
0 commit comments