Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-built image not used as-is #6558

Open
chrmarti opened this issue Apr 4, 2022 · 2 comments
Open

Pre-built image not used as-is #6558

chrmarti opened this issue Apr 4, 2022 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers

Comments

@chrmarti
Copy link
Contributor

chrmarti commented Apr 4, 2022

Apologies if this is the wrong place to ask, but would the proposal above address the fact that running devcontainer build followed by devcontainer open opens VS Code but then in the output one of the first things it does is start building stuff again?

[1690 ms] Start: Run: docker events --format {{json .}} --filter event=start
[1692 ms] Start: Run: docker-compose --project-name myproject -f /Users/username/Projects/myproject/docker-compose.yml build

It makes for a very slow startup experience since I cannot interact with the editor until the build completes. What is also non-intuitive for me is that even though it rebuilds after opening the dev container, I am sometimes still prompted that e.g. docker-compose.yml has changed and may need to be rebuilt. How many times does it need to build before VS Code is content that everything is in working shape and can let me get to work?

Originally posted by @jsma in devcontainers/spec#21 (comment)

@chrmarti chrmarti self-assigned this Apr 4, 2022
@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers labels Apr 4, 2022
@jsma
Copy link

jsma commented Apr 6, 2022

I just tried the devcontainer build && devcontainer open on a clean checkout of a bare bones docker-compose/dev container setup WITHOUT any features and everything works as I'd expect. VS Code terminal output shows a straightforward docker-compose up without any additional prompts.

As a test, I shut down VS Code and added the "github-cli": "latest", as the one and only feature using a text editor. I ran devcontainer build which shows docker doing its thing followed by devcontainer open. The VS Code terminal output shows a normal docker-compose up but then I get this prompt:

Screen Shot 2022-04-05 at 4 43 45 PM

Clicking "Rebuild" does trigger the docker-compose build again of course:

[1462 ms] Start: Run: docker events --format {{json .}} --filter event=start
[1463 ms] Start: Run: docker-compose --project-name wagtail-vs-code-demo -f /Users/username/Projects/wagtail-vs-code-demo/docker-compose.debug.yml -f /Users/username/Projects/wagtail-vs-code-demo/.devcontainer/docker-compose.yml build

I was under the impression that devcontainer build would do whatever it would normally do had I simply used devcontainer open and then used the command palette to rebuild the dev container. As a VS Code newbie, I found it confusing that the command line build step is followed by a prompt in the UI to "Rebuild".

@chrmarti
Copy link
Contributor Author

devcontainer build doesn't have access to the checksum we use in the extension to see if the configuration changed. One option might be to store a checksum on / in the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

2 participants