Skip to content

Commit

Permalink
Fix Dev Container KBN_DIR (#195810)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
Ikuni17 authored Oct 29, 2024
1 parent 8700807 commit 686b021
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "Kibana",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
"context": "..",
"args": {
"KBN_DIR": "${containerWorkspaceFolder}"
}
},
"customizations": {
"vscode": {
Expand Down

0 comments on commit 686b021

Please sign in to comment.