feature(helpers): change docker run cmd

- add user specification so UID/GID always specified
- add container default values
This commit is contained in:
Asif Bacchus 2021-07-26 01:36:41 -06:00
parent e208d22664
commit 2e2c93b2b1
2 changed files with 8 additions and 3 deletions

View File

@ -17,10 +17,11 @@
# ensure the container can read and/or write to locations on the host or
# has access to files shared between members of a container stack.
# REQUIRED: NO
# DEFAULT: UID=8080, GID=8080
# DEFAULT: NGINX_UID=8080, NGINX_GID=8080
# VALID OPTIONS: any permissible and available UID/GID value
#UID=8080
#GID=8080
#NGINX_UID=8080
#NGINX_GID=8080
#
# Network options

View File

@ -218,6 +218,7 @@ if [ -z "$SSL_CERT" ]; then
# shellcheck disable=SC2086
docker run --rm -it --name "${container_name}" \
--env-file ab-nginx.params \
--user="${NGINX_UID:-8080}:${NGINX_GID:-8080}" \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
--network=${NETWORK} \
@ -229,6 +230,7 @@ if [ -z "$SSL_CERT" ]; then
# shellcheck disable=SC2086
docker run -d --name "${container_name}" \
--env-file ab-nginx.params \
--user="${NGINX_UID:-8080}:${NGINX_GID:-8080}" \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
--network=${NETWORK} \
@ -247,6 +249,7 @@ else
# shellcheck disable=SC2086
docker run --rm -it --name "${container_name}" \
--env-file ab-nginx.params \
--user="${NGINX_UID:-8080}:${NGINX_GID:-8080}" \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
--network=${NETWORK} \
@ -264,6 +267,7 @@ else
# shellcheck disable=SC2086
docker run -d --name "${container_name}" \
--env-file ab-nginx.params \
--user="${NGINX_UID:-8080}:${NGINX_GID:-8080}" \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
--network=${NETWORK} \