question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run initializeCommand for `devcontainer build`

See original GitHub issue

When

$ devcontainer build --workspace-folder . 

Expected

By default, things like initialcommand are called.

Actual

Things like initialcommand are not called.

Feat

All default things vscode devcontainer does, like xxxcommand , extensions, cwd…

$ ls .devcontainer/devcontainer.json
.devcontainer/devcontainer.json
$ devcontainer vscode build
Run initialcommand
...
Start: Run: docker build
Step 1: FROM
Step 2: RUN xxx
Step 3: RUN xxx
...

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chrmarticommented, Sep 27, 2022

@loynoir Make sure you use "initializeCommand". That should work.

1reaction
chrmarticommented, Sep 27, 2022

build only builds the image. up will also run the commands: devcontainer up --workspace-folder .

Does that make it work?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Start a processes when a container starts - Visual Studio Code
The easiest way to do this is using the postStartCommand property in devcontainer.json . For example, if you wanted to run yarn install...
Read more >
Test: "initializeCommand" in devcontainer.json #2407 - GitHub
"initializeCommand" in the devcontainer.json is an optional property that can be set to a string (run in a shell) or an array of...
Read more >
Dev Container metadata reference
The devcontainer.json file contains any needed metadata and settings required to configurate a development container for a given well-defined tool and ...
Read more >
Configuring environment variables prior to creation of dev ...
My solution is to create an env file in the initializeCommand and pass it with the build context. Here is the .devcontainer/devcontainer.
Read more >
Using Docker as a Dev Environment with VS Code: Part 2
Let's set up this app to run in a set of Docker containers using this ... and volume exist before creating containers "initializeCommand": ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found