tangled
alpha
login
or
join now
mgabarda.com
/
docker-postgres
0
fork
atom
Docker images for postgres extended with management bash scripts.
0
fork
atom
overview
issues
pulls
pipelines
chore: updated to use generic Dockerfile
mgabarda.com
3 months ago
ce4dc736
d38abae9
+55
-99
16 changed files
expand all
collapse all
unified
split
Makefile
postgis
11-2.5
Dockerfile
12-3.0
Dockerfile
13-3.1
Dockerfile
14-3.4
Dockerfile
15-3.4
Dockerfile
16-3.4
Dockerfile
Dockerfile
postgres
10
Dockerfile
11
Dockerfile
12
Dockerfile
13
Dockerfile
14
Dockerfile
15
Dockerfile
16
Dockerfile
Dockerfile
+29
-21
Makefile
···
1
1
# Variables
2
2
# ------------------------------------------------------------------------------
3
3
-
POSTGRES_IMAGE_ID := marcosgabarda/postgres
4
4
-
POSTGIS_IMAGE_ID := marcosgabarda/postgis
3
3
+
POSTGRES_IMAGE_ID := quay.io/marcosgabarda/postgres
4
4
+
POSTGIS_IMAGE_ID := quay.io/marcosgabarda/postgis
5
5
6
6
# Versions to build
7
7
# ------------------------------------------------------------------------------
8
8
-
POSTGRES_VERSIONS := 10 11 12 13 14 15
9
9
-
POSTGRES_LATEST_VERSION := 16
10
10
-
POSTGIS_VERSIONS := 11-2.5 12-3.0 13-3.1 14-3.4 15-3.4
11
11
-
POSTGIS_LATEST_VERSION := 16-3.4
8
8
+
POSTGRES_VERSIONS := 12 13 14 15 16 17
9
9
+
POSTGRES_LATEST_VERSION := 18
10
10
+
POSTGIS_VERSIONS := 12-3.0 13-3.1 14-3.4 15-3.4 16-3.5 17-3.6
11
11
+
POSTGIS_LATEST_VERSION := 18-3.6
12
12
+
13
13
+
# Docker command
14
14
+
# ------------------------------------------------------------------------------
15
15
+
DOCKER := podman
12
16
13
13
-
.PHONY: build_postgres push_postgres build_postgis push_postgis build push
17
17
+
.PHONY: build-postgres push-postgres build-postgis push-postgis build push
14
18
15
15
-
build_postgres:
19
19
+
build-postgres:
16
20
@for version in $(POSTGRES_VERSIONS) ; do \
17
17
-
docker buildx build . -f ./postgres/$$version/Dockerfile --tag ${POSTGRES_IMAGE_ID}:$$version --platform linux/amd64,linux/arm64 ; \
21
21
+
${DOCKER} build . -f ./postgres/Dockerfile --tag ${POSTGRES_IMAGE_ID}:$$version --build-arg POSTGRES_VERSION=$$version --platform linux/amd64 ; \
18
22
done
19
19
-
docker buildx build . -f ./postgres/${POSTGRES_LATEST_VERSION}/Dockerfile --tag ${POSTGRES_IMAGE_ID}:${POSTGRES_LATEST_VERSION} --tag ${POSTGRES_IMAGE_ID}:latest --platform linux/amd64,linux/arm64
23
23
+
${DOCKER} build . -f ./postgres/Dockerfile --tag ${POSTGRES_IMAGE_ID}:${POSTGRES_LATEST_VERSION} --tag ${POSTGRES_IMAGE_ID}:latest --build-arg POSTGRES_VERSION=${POSTGRES_LATEST_VERSION} --platform linux/amd64
20
24
21
21
-
push_postgres:
25
25
+
push-postgres: build-postgres
22
26
@for version in $(POSTGRES_VERSIONS) ; do \
23
23
-
docker buildx build . -f ./postgres/$$version/Dockerfile --tag ${POSTGRES_IMAGE_ID}:$$version --platform linux/amd64,linux/arm64 --push ; \
27
27
+
${DOCKER} push ${POSTGRES_IMAGE_ID}:$$version ; \
24
28
done
25
25
-
docker buildx build . -f ./postgres/${POSTGRES_LATEST_VERSION}/Dockerfile --tag ${POSTGRES_IMAGE_ID}:${POSTGRES_LATEST_VERSION} --tag ${POSTGRES_IMAGE_ID}:latest --platform linux/amd64,linux/arm64 --push
29
29
+
${DOCKER} push ${POSTGRES_IMAGE_ID}:${POSTGRES_LATEST_VERSION}
30
30
+
${DOCKER} push ${POSTGRES_IMAGE_ID}:latest
26
31
27
27
-
build_postgis:
32
32
+
build-postgis:
28
33
@for version in $(POSTGIS_VERSIONS) ; do \
29
29
-
docker buildx build . -f ./postgis/$$version/Dockerfile --tag ${POSTGIS_IMAGE_ID}:$$version --tag ${POSTGIS_IMAGE_ID}:$(word 1, $(subst -, ,$$version)) --platform linux/amd64,linux/arm64 ; \
34
34
+
${DOCKER} build . -f ./postgis/Dockerfile --tag ${POSTGIS_IMAGE_ID}:$$version --tag ${POSTGIS_IMAGE_ID}:$(word 1, $(subst -, ,$$version)) --build-arg POSTGIS_VERSION=$$version --platform linux/amd64 ; \
30
35
done
31
31
-
docker buildx build . -f ./postgis/${POSTGIS_LATEST_VERSION}/Dockerfile --tag ${POSTGIS_IMAGE_ID}:${POSTGIS_LATEST_VERSION} --tag ${POSTGIS_IMAGE_ID}:$(word 1, $(subst -, ,$(POSTGIS_LATEST_VERSION))) --tag ${POSTGIS_IMAGE_ID}:latest --platform linux/amd64,linux/arm64
36
36
+
${DOCKER} build . -f ./postgis/Dockerfile --tag ${POSTGIS_IMAGE_ID}:${POSTGIS_LATEST_VERSION} --tag ${POSTGIS_IMAGE_ID}:$(word 1, $(subst -, ,$(POSTGIS_LATEST_VERSION))) --tag ${POSTGIS_IMAGE_ID}:latest --build-arg POSTGIS_VERSION=${POSTGIS_LATEST_VERSION} --platform linux/amd64
32
37
33
33
-
push_postgis:
38
38
+
push-postgis: build-postgis
34
39
@for version in $(POSTGIS_VERSIONS) ; do \
35
35
-
docker buildx build . -f ./postgis/$$version/Dockerfile --tag ${POSTGIS_IMAGE_ID}:$$version --tag ${POSTGIS_IMAGE_ID}:$(word 1, $(subst -, ,$$version)) --platform linux/amd64,linux/arm64 --push ; \
40
40
+
${DOCKER} push ${POSTGIS_IMAGE_ID}:$$version ; \
41
41
+
${DOCKER} push ${POSTGIS_IMAGE_ID}:$(word 1, $(subst -, ,$$version)); \
36
42
done
37
37
-
docker buildx build . -f ./postgis/${POSTGIS_LATEST_VERSION}/Dockerfile --tag ${POSTGIS_IMAGE_ID}:${POSTGIS_LATEST_VERSION} --tag ${POSTGIS_IMAGE_ID}:14 --tag ${POSTGIS_IMAGE_ID}:latest --platform linux/amd64,linux/arm64 --push
43
43
+
${DOCKER} push ${POSTGIS_IMAGE_ID}:${POSTGIS_LATEST_VERSION}
44
44
+
${DOCKER} push ${POSTGIS_IMAGE_ID}:$(word 1, $(subst -, ,${POSTGIS_LATEST_VERSION}))
45
45
+
${DOCKER} push ${POSTGIS_IMAGE_ID}:latest
38
46
39
39
-
build: build_postgres build_postgis
47
47
+
build: build-postgres build-postgis
40
48
41
41
-
push: push_postgres push_postgis
49
49
+
push: push-postgres push-postgis
-6
postgis/11-2.5/Dockerfile
···
1
1
-
FROM postgis/postgis:11-2.5-alpine
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgis/12-3.0/Dockerfile
···
1
1
-
FROM postgis/postgis:12-3.0-alpine
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgis/13-3.1/Dockerfile
···
1
1
-
FROM postgis/postgis:13-3.1-alpine
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgis/14-3.4/Dockerfile
···
1
1
-
FROM postgis/postgis:14-3.4-alpine
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgis/15-3.4/Dockerfile
···
1
1
-
FROM postgis/postgis:15-3.4-alpine
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgis/16-3.4/Dockerfile
···
1
1
-
FROM postgis/postgis:16-3.4-alpine
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
+12
postgis/Dockerfile
···
1
1
+
# parametrize docker image and tag
2
2
+
# ------------------------------------------------------------------------------
3
3
+
ARG POSTGIS_IMAGE=docker.io/postgis/postgis
4
4
+
ARG POSTGIS_VERSION=16-3.4
5
5
+
FROM ${POSTGIS_IMAGE}:${POSTGIS_VERSION}-alpine
6
6
+
7
7
+
# copy maintenance scripts
8
8
+
# ------------------------------------------------------------------------------
9
9
+
COPY ./maintenance /usr/local/bin/maintenance
10
10
+
RUN chmod +x /usr/local/bin/maintenance/*
11
11
+
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
12
12
+
&& rmdir /usr/local/bin/maintenance
-6
postgres/10/Dockerfile
···
1
1
-
FROM postgres:10
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgres/11/Dockerfile
···
1
1
-
FROM postgres:11
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgres/12/Dockerfile
···
1
1
-
FROM postgres:12
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgres/13/Dockerfile
···
1
1
-
FROM postgres:13
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgres/14/Dockerfile
···
1
1
-
FROM postgres:14
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgres/15/Dockerfile
···
1
1
-
FROM postgres:15
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
-6
postgres/16/Dockerfile
···
1
1
-
FROM postgres:16
2
2
-
3
3
-
COPY ./maintenance /usr/local/bin/maintenance
4
4
-
RUN chmod +x /usr/local/bin/maintenance/*
5
5
-
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
6
6
-
&& rmdir /usr/local/bin/maintenance
+14
postgres/Dockerfile
···
1
1
+
# parametrize docker image and tag
2
2
+
# ------------------------------------------------------------------------------
3
3
+
ARG POSTGRES_IMAGE=docker.io/postgres
4
4
+
ARG POSTGRES_VERSION=16
5
5
+
6
6
+
FROM ${POSTGRES_IMAGE}:${POSTGRES_VERSION}
7
7
+
8
8
+
# copy maintenance scripts
9
9
+
# ------------------------------------------------------------------------------
10
10
+
11
11
+
COPY ./maintenance /usr/local/bin/maintenance
12
12
+
RUN chmod +x /usr/local/bin/maintenance/*
13
13
+
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \
14
14
+
&& rmdir /usr/local/bin/maintenance