client: lib_docker: add USER/WORKDIR to finalize Dockerfile

Guarantees that any additions to custom Dockerfile (or a missing custom)
will not prevent bringing `up` a container into the correct environment.
This commit is contained in:
2024-07-27 16:13:22 -07:00
parent c49e0ad795
commit e9bd7f322f

View File

@@ -290,6 +290,16 @@ function lib_docker::__build()
"$global_custom_dockerfile" >>"$_final" || return $?
fi
#
# Finalize Dockerfile
#
# Guarantees that any additions to custom Dockerfile (or a missing custom)
# will not prevent bringing `up` a container into the correct environment.
lib_utils::print_debug "Finalizing '${_final}'"
echo -e "# WARNING: keep at end of file\nUSER ${DOCKER_FINANCE_USER}\nWORKDIR /home/${DOCKER_FINANCE_USER}\n" \
>>"$_final"
#
# Execute
#