From 2897f6d66e36f60ad48c60960633c8a5cf863faa Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 18 Sep 2024 08:26:09 -0400 Subject: [PATCH] Updating Devcontainer Dockerfile so the vscode user can run bootstrap (#193224) ## Summary There was a permissions issue running bootstrap in the devContainer on Mac. --- .devcontainer/.env.template | 3 ++- .devcontainer/Dockerfile | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.devcontainer/.env.template b/.devcontainer/.env.template index 3ca02c49bfa9c..b812dc9659a02 100644 --- a/.devcontainer/.env.template +++ b/.devcontainer/.env.template @@ -1,4 +1,5 @@ # /bin/bash or /bin/zsh (oh-my-zsh is installed by default as well) SHELL=/bin/bash -# Switch to 1 to enable FIPS environment, any other value to disable +# Switch to 1 to enable FIPS environment, any other value to disable, +# then close and reopen a new terminal to setup the environment FIPS=0 diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 539e23a4a3a31..142e5ce933777 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -49,6 +49,9 @@ WORKDIR ${KBN_DIR} # Node and NVM setup COPY .node-version /tmp/ + +USER vscode + RUN mkdir -p $NVM_DIR && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh | bash && \ . "$NVM_DIR/nvm.sh" && \ @@ -61,6 +64,8 @@ RUN mkdir -p $NVM_DIR && \ echo "source $NVM_DIR/nvm.sh" >> ${HOME}/.zshrc && \ chown -R 1000:1000 "${HOME}/.npm" +USER root + # Reload the env everytime a new shell is opened incase the .env file changed. RUN echo "source $KBN_DIR/.devcontainer/scripts/env.sh" >> ${HOME}/.bashrc && \ echo "source $KBN_DIR/.devcontainer/scripts/env.sh" >> ${HOME}/.zshrc