From 448f129f0494d1f9676d3ea22c7cc804046cbfe6 Mon Sep 17 00:00:00 2001 From: Kat Morgan Date: Wed, 10 Jan 2024 16:29:19 -0800 Subject: [PATCH 1/2] add direnv to the container image to support setting environment variables in code --- Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4a5185b..ce37a8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -123,6 +123,18 @@ RUN set -ex \ && rm -rf /tmp/* \ && true +# Install direnv +RUN set -ex \ + && echo 'eval "\$(direnv hook $SHELL)"' | sudo tee -a /etc/skel/.bashrc | tee -a ${HOME}/.bashrc \ + && curl --output /tmp/install.sh --proto '=https' --tlsv1.2 -Sf -L "https://direnv.net/install.sh" \ + && chmod +x /tmp/install.sh \ + && sudo bash -c "/tmp/install.sh" \ + && direnv --version \ + && source ${HOME}/.bashrc \ + && direnv allow \ + && sudo rm -rf /tmp/* \ + && true + # Install golang # TODO: relocate install to devbox ARG GO_PKGS="\ From b069f86627e2eb68d0e9980b2fc76afcff9a7d9f Mon Sep 17 00:00:00 2001 From: Kat Morgan Date: Wed, 10 Jan 2024 19:37:24 -0800 Subject: [PATCH 2/2] remove non-critical commands --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce37a8c..59fda28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -130,8 +130,6 @@ RUN set -ex \ && chmod +x /tmp/install.sh \ && sudo bash -c "/tmp/install.sh" \ && direnv --version \ - && source ${HOME}/.bashrc \ - && direnv allow \ && sudo rm -rf /tmp/* \ && true