Fix Dev Container KBN_DIR (#195810)

## Summary

In #193488, `KBN_DIR` was changed to be a dynamic variable. It wasn't
being properly propagated through the build process in the Dockerfile
and the full path to `env.sh` wasn't being set. This passes the
directory as a build `ARG` as well to fix the path.
This commit is contained in:
Brad White 2024-10-28 18:44:36 -06:00 committed by GitHub
parent 8700807899
commit 686b0214ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -1,5 +1,7 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
ARG KBN_DIR
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
ENV HOME=/home/vscode
ENV NVM_DIR=${HOME}/nvm
@ -67,8 +69,8 @@ RUN mkdir -p $NVM_DIR && \
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
RUN echo "source ${KBN_DIR}/.devcontainer/scripts/env.sh" >> ${HOME}/.bashrc && \
echo "source ${KBN_DIR}/.devcontainer/scripts/env.sh" >> ${HOME}/.zshrc
# This is for documentation. Ports are exposed via devcontainer.json
EXPOSE 9200 5601 9229 9230 9231

View file

@ -2,7 +2,10 @@
"name": "Kibana",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
"context": "..",
"args": {
"KBN_DIR": "${containerWorkspaceFolder}"
}
},
"customizations": {
"vscode": {