From e9bd7f322f80865d267374f6ee259f0b20aa7ac8 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Sat, 27 Jul 2024 16:13:22 -0700 Subject: [PATCH] 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. --- client/src/docker/lib/internal/lib_docker.bash | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/src/docker/lib/internal/lib_docker.bash b/client/src/docker/lib/internal/lib_docker.bash index 1214ecd..d83c307 100644 --- a/client/src/docker/lib/internal/lib_docker.bash +++ b/client/src/docker/lib/internal/lib_docker.bash @@ -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 #