From c49e0ad7950121adaaed7550e8272680f2b52e6d Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Sat, 27 Jul 2024 16:00:23 -0700 Subject: [PATCH 1/3] client: lib_gen: fix missing directory slash --- client/src/docker/lib/internal/lib_gen.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/docker/lib/internal/lib_gen.bash b/client/src/docker/lib/internal/lib_gen.bash index 15a2953..c78120b 100644 --- a/client/src/docker/lib/internal/lib_gen.bash +++ b/client/src/docker/lib/internal/lib_gen.bash @@ -233,7 +233,7 @@ function lib_gen::__set_client_globals() lib_utils::print_debug "global_env_file=${global_env_file}" # Custom Dockerfile (if available) - local _client_dockerfile_dir="${DOCKER_FINANCE_CLIENT_CONF}${global_tag_dir}/Dockerfiles" + local _client_dockerfile_dir="${DOCKER_FINANCE_CLIENT_CONF}/${global_tag_dir}/Dockerfiles" [ ! -d "$_client_dockerfile_dir" ] && mkdir -p "$_client_dockerfile_dir" global_custom_dockerfile="${_client_dockerfile_dir}/${global_conf_filename}" lib_utils::print_debug "global_custom_dockerfile=${global_custom_dockerfile}" From e9bd7f322f80865d267374f6ee259f0b20aa7ac8 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Sat, 27 Jul 2024 16:13:22 -0700 Subject: [PATCH 2/3] 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 # From 6b5c8af925ce9138ad0a7115ab086e9c87833efe Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Sat, 27 Jul 2024 22:05:31 -0700 Subject: [PATCH 3/3] client: docker.bash: fix help usage (dev-tools alias) --- client/src/docker/docker.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/docker/docker.bash b/client/src/docker/docker.bash index 5f66882..fa69673 100755 --- a/client/src/docker/docker.bash +++ b/client/src/docker/docker.bash @@ -131,7 +131,7 @@ function main() $ alias dev-tools=\"$0 dev-tools${global_arg_delim_1}${USER}:latest\" \e[37;2m# Generate environment and build default image\e[0m - $ dev-tools gen && docker-finance_dev-tools build type${global_arg_delim_2}default + $ dev-tools gen && dev-tools build type${global_arg_delim_2}default \e[37;2m# Spawn a container with given command (removed after command finishes)\e[0m $ dev-tools run 'shellcheck --version'