From 448f129f0494d1f9676d3ea22c7cc804046cbfe6 Mon Sep 17 00:00:00 2001 From: Kat Morgan Date: Wed, 10 Jan 2024 16:29:19 -0800 Subject: [PATCH] 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="\