While running docker image, I am receiving the following error:
/entrypoint.sh: line 7: USER: unbound variable
Code of entrypoint.sh.
#!/bin/bash
set -euo pipefail
export SPARK_DIST_CLASSPATH=$(hadoop classpath)
POSTGRES_TIMEOUT=60
echo "Running as: ${USER}"
if [ "${USER}" != "root" ]; then
echo "Changing owner of files in ${AIRFLOW_HOME} to ${USER}"
chown -R "${USER}" ${AIRFLOW_HOME}
fi
set +e
Declaration of Environment variable user in Docker File:
# Delay creation of user and group
ONBUILD ARG THEUSER=afpuser
ONBUILD ARG THEGROUP=hadoop
ONBUILD ENV USER ${THEUSER}
ONBUILD ENV GROUP ${THEGROUP}
ONBUILD RUN groupadd -r "${GROUP}" && useradd -rmg "${GROUP}" "${USER}"
Full code of Docker image is present in the Link
entrypoint.sh
. That will be easier for people to answer – EarthquakeONBUILD
commands run, if your docker image is used as a base image for a derived build. You might need to add the same lines twice - once ifONBUILD
, once without. (Not exactly sure what you want to achieve...) – Chiropodistbitnami/postgresql
chart, see this thread instead. It could be due to a dollar sign $ in the password./entrypoint.sh: line 17: $4: unbound variable
github.com/bitnami/bitnami-docker-postgresql/issues/213 – Hereinafter