Skip to content

Commit 52399c7

Browse files
committed
fix: clean up docker build
1 parent bc125b8 commit 52399c7

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

.github/workflows/dockerhub-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ on:
1111
jobs:
1212
docker_release:
1313
runs-on: ubuntu-20.04
14+
timeout-minutes: 100
15+
1416
steps:
1517
- uses: actions/checkout@v2
16-
18+
1719
- id: settings
1820
run: |
1921
apt update --yes && apt install --yes jq

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ FROM postgres:$VERSION
44

55
COPY ansible/ /tmp/ansible/
66

7+
ENV DEBIAN_FRONTEND noninteractive
8+
79
RUN apt update && \
8-
apt install -y ansible && \
10+
apt install -y ansible sudo git && \
11+
apt -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade && \
912
cd /tmp/ansible && \
1013
ansible-playbook playbook-docker.yml && \
11-
apt -y update && \
12-
apt -y upgrade && \
1314
apt -y autoremove && \
1415
apt -y autoclean && \
1516
apt install -y default-jdk-headless locales && \
1617
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
1718
locale-gen && \
18-
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
19+
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
1920

2021
ENV LANGUAGE en_US.UTF-8
2122
ENV LANG en_US.UTF-8

ansible/tasks/docker/setup.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- name: Install Python3
2-
raw: apt update && apt upgrade -y && apt install python3 -y
2+
raw: export DEBIAN_FRONTEND=noninteractive ; sh -c "apt update && apt upgrade -y && apt install python3 -y"
3+
timeout: 300
34

45
- name: Setup - install common dependencies
56
apt:

ansible/tasks/postgres-extensions/22-pg_jsonschema.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@
3838
version: "{{ pg_jsonschema_release }}"
3939

4040
- name: pg_jsonschema - temporarily transfer ownership to postgres
41+
become: yes
4142
file:
4243
path: '{{ item }}'
4344
recurse: yes
4445
owner: postgres
4546
group: postgres
4647
with_items:
4748
- /tmp/pg_jsonschema
48-
- /usr/lib/postgresql/lib
49+
- /usr/lib/postgresql/lib # AMI
50+
- /usr/lib/postgresql/14/lib # Docker Image
51+
- /usr/share/postgresql/14
4952

5053
- name: pg_jsonschema - install
5154
become: yes
@@ -56,7 +59,11 @@
5659

5760
- name: pg_jsonschema - return ownership to root
5861
file:
59-
path: /usr/lib/postgresql/lib
62+
path: '{{ item }}'
6063
recurse: yes
6164
owner: root
6265
group: root
66+
with_items:
67+
- /usr/lib/postgresql/lib
68+
- /usr/lib/postgresql/14/lib
69+
- /usr/share/postgresql/14

docker.vars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"docker-version": "14.1.0.55",
2+
"docker-version": "14.1.0.60",
33
"postgres-version": "14.1"
44
}
55

0 commit comments

Comments
 (0)