Skip to content

Commit 13cd5f3

Browse files
authored
Update Dockerfile to address warnings (hapostgres#1039)
Addresses the following warnings: - FromAsCasing - LegacyKeyValueFormat - JSONArgsRecommended
1 parent 5b36298 commit 13cd5f3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG PGVERSION=14
1010
#
1111
# This base image contains all our target Postgres versions.
1212
#
13-
FROM debian:bullseye-slim as base
13+
FROM debian:bullseye-slim AS base
1414

1515
ARG PGVERSION
1616

@@ -81,12 +81,12 @@ RUN adduser docker sudo
8181
RUN adduser docker postgres
8282
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
8383

84-
FROM base as citus
84+
FROM base AS citus
8585

8686
ARG PGVERSION
8787
ARG CITUSTAG=v11.1.2
8888

89-
ENV PG_CONFIG /usr/lib/postgresql/${PGVERSION}/bin/pg_config
89+
ENV PG_CONFIG=/usr/lib/postgresql/${PGVERSION}/bin/pg_config
9090

9191
RUN git clone -b ${CITUSTAG} --depth 1 https://github.com/citusdata/citus.git /usr/src/citus
9292
WORKDIR /usr/src/citus
@@ -99,11 +99,11 @@ RUN make -s clean && make -s -j8 install
9999
# pg_auto_failover for a given --build-arg PGVERSION target version of
100100
# Postgres.
101101
#
102-
FROM citus as build
102+
FROM citus AS build
103103

104104
ARG PGVERSION
105105

106-
ENV PG_CONFIG /usr/lib/postgresql/${PGVERSION}/bin/pg_config
106+
ENV PG_CONFIG=/usr/lib/postgresql/${PGVERSION}/bin/pg_config
107107

108108
WORKDIR /usr/src/pg_auto_failover
109109

@@ -119,7 +119,7 @@ RUN make -s clean && make -s install -j8
119119
# Given the build image above, we can now run our test suite targetting a
120120
# given version of Postgres.
121121
#
122-
FROM build as test
122+
FROM build AS test
123123

124124
ARG PGVERSION
125125

@@ -136,7 +136,7 @@ ENV PATH /usr/lib/postgresql/${PGVERSION}/bin:/usr/local/sbin:/usr/local/bin:/us
136136
#
137137
# And finally our "run" images with the bare minimum for run-time.
138138
#
139-
FROM debian:bullseye-slim as run
139+
FROM debian:bullseye-slim AS run
140140

141141
ARG PGVERSION
142142

@@ -192,8 +192,8 @@ RUN mkdir -p /var/lib/postgres \
192192
&& chown -R docker /var/lib/postgres
193193

194194
USER docker
195-
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/${PGVERSION}/bin
196-
ENV PG_AUTOCTL_DEBUG 1
197-
ENV PGDATA /var/lib/postgres/pgaf
195+
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/${PGVERSION}/bin
196+
ENV PG_AUTOCTL_DEBUG=1
197+
ENV PGDATA=/var/lib/postgres/pgaf
198198

199-
CMD pg_autoctl do tmux session --nodes 3 --binpath /usr/local/bin/pg_autoctl
199+
CMD ["pg_autoctl", "do tmux session --nodes 3 --binpath /usr/local/bin/pg_autoctl"]

0 commit comments

Comments
 (0)