Replies: 1 comment
-
I think you can use one of the lifecycle hook commands: https://containers.dev/implementors/json_reference/#lifecycle-scripts I think the best spot to put it is in the updateContentCommand, but you could also use the postCreateCommand if you want. // devcontainer.json
{
"features": {
"ghcr.io/devcontainers/features/node:1": {}
},
"updateContentCommand": "npm install -g docsify-cli"
// OR
"postCreateCommand": "npm install -g docsify-cli"
} example: "image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "npm install -g @devcontainers/cli", https://github.com/devcontainers/features/blob/main/.devcontainer.json#L11-L14 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm converting a dev container based on a Dockerfile to a dev container that uses Features.
For example, my Dockerfile contains this:
Moving forward, I want to use the Feature:
Question: where can I put the
npm install -g
command? I can't leave it in my Dockerfile, because npm will not be available at that point.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions