Replace static version in postgres with variable

This commit is contained in:
Arif Herusetyo Wicaksono 2019-01-19 15:45:36 +09:00
parent 041e4c6ebc
commit 13fc0223b0

View File

@ -6,7 +6,8 @@ This quick start deployment utilizes Alpine-based image.
```bash
# pull the image from docker hub
docker pull postgresql:10-alpine
VERSION=
docker pull postgresql:"$VERSION"
# define environment variables
cat << EOF > POSTGRESENV
@ -19,11 +20,11 @@ EOF
PGSRV=
PGSRVPORT=
docker run -d --name ${PGSRV} --env-file POSTGRESENV -p ${PGSRVPORT}:5432 postgres:10-alpine
docker run -d --name "${PGSRV}" --env-file POSTGRESENV -p "${PGSRVPORT}":5432 postgres:"$VERSION"
# specify container name for psql configuration, if needed
PGCLI=
docker run -d --name ${PGCLI} postgres:10-alpine
docker run -d --name "${PGCLI}" postgres:"$VERSION"
# connect using client container, enter password when prompted
PGUSER=