diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7a864fc303..f53cc21711 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,9 @@ { "name": "Vald", - "dockerFile": "../dockers/dev/Dockerfile", - "context": "..", + "image": "vdaas/vald-dev-container:nightly", + // Specify the Dockerfile below directly if you need to make customizations + // "dockerFile": "../dockers/dev/Dockerfile", + // "context": "..", "runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"], "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": { @@ -11,7 +13,17 @@ } }, "remoteUser": "root", - "postCreateCommand": "go version", - "postAttachCommand": "mkdir -p /etc/server && ln -s $(pwd)/cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml", - "appPort": "3000:3000" + "workspaceFolder": "/go/src/github.com/vdaas/vald", + "workspaceMount": "source=${localWorkspaceFolder},target=/go/src/github.com/vdaas/vald,type=bind,consistency=delegated", + + // To access grafana + "appPort": "3000:3000", + + // Persist zsh history settings below + // overwrite HISTFILE to store history file in the named volume defined below + // also setting INC_APPEND_HISTORY to immediately flush command history to the file to keep history when rebuilding the devcontainer + "postStartCommand": "echo 'export HISTFILE=/commandhistory/.zsh_history' >> /root/.zshrc && echo 'setopt INC_APPEND_HISTORY' >> /root/.zshrc", + // define named volume to store zsh history file + "mounts": ["source=zshhistory-named-volume,target=/commandhistory,type=volume"], + "postAttachCommand": "mkdir -p /etc/server && ln -s $(pwd)/cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml" }