- Notifications
You must be signed in to change notification settings - Fork 349
Fix issue when using custom BuildKit frontend #316
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
base: main
Are you sure you want to change the base?
Conversation
| @microsoft-github-policy-service agree company="Bloomberg" |
chrmarti left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have left a comment regarding the original reason we merged the two image builds.
src/spec-node/singleContainer.ts Outdated
| if (modifiedDockerfile) { | ||
| dockerfile = modifiedDockerfile; | ||
| | ||
| const intermediateBuildAargs = ["build", "-f", dockerfilePath, "-t"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using two builds had the issues mentioned in microsoft/vscode-remote-release#6848 (comment).
| Thank you @chrmarti , are multi-platform builds only supported with the single container workflow? This seems to be the case according to cli/src/spec-node/devContainersSpecCLI.ts Lines 409 to 413 in 38c025e
We are only blocked on docker-compose workflows, I can revert the changes to |
| I would prefer to keep the two code paths (single container and docker-compose) in sync to avoid having subtly different behaviors. What about the following options:
|
I've moved the changes behind a flag is that in line with what you had in mind? |
| Hi @chrmarti, following up on this thread, have you had a chance to review the changes? :) |
| Hi @chrmarti , can i please get an update on this? |
| @AbdullahWali Sorry for the delay, I will do a review in next days. Thanks for your patience. |
It been nearly a month, could this be reviewed? This would unblock using custom buildkit dockerfiles with devcontainers |
| Hi @chrmarti, have you had a chance to review this? We are blocked on enabling docker-compose v2 due to this issue |
| Hi @chrmarti, following up on this. Our company utilises custom frontends heavily for our local development workflows, and thus are stuck on version 0.234.0 of Devcontainers. This version breaks when enabling docker-compose V2 [1], so we are also unable to use docker-compose V2 until this is resolved. Starting from April we won't be able to disable docker-compose V2 [2], so we'll be forced to move away from Devcontainers for our local development if we can't resolve this issue. We'd like to keep using VSCode + Devcontainers ideally, so we'd appreciate your support on progressing with resolving this PR/issue. If there are any further changes to this PR which you think are needed then please let me know. I'd like to help in any way I can. [1] microsoft/vscode-remote-release#7047 |
chrmarti left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, left a few comments for discussion.
| overrideFeatureInstallOrder?: string[]; | ||
| hostRequirements?: HostRequirements; | ||
| customizations?: Record<string, any>; | ||
| prebuildDockerfile?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should indeed make this a flag on the devcontainer.json. The way we build the image seems to be an implementation detail that shouldn't necessarily surface there. Two alternatives:
- Check if the "syntax" image is a docker/dockerfile image (we already have code doing this), if not: prebuild the Dockerfile.
- Come up with our own custom builder inside of which we can run the two build steps (user's Dockerfile and container features' Dockerfile) making it look from the outside as one single build step. (Not sure if this is possible and how hard it would be to implement.)
Another reason to avoid the flag in the devcontainer.json is that we can avoid the new code path when we don't have anything to add with a separate Dockerfile.
src/spec-node/singleContainer.ts Outdated
| const intermediateBuildAargs = ['build', '-f', dockerfilePath, '-t']; | ||
| let intermediateImageName = 'vsc_tmp_' + cliHost.path.basename(buildContextPath); | ||
| intermediateBuildAargs.push(intermediateImageName); | ||
| intermediateBuildAargs.push(buildContextPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--target from the devcontainer.json needs to apply here like below.
Should we add --platform, --push, --output, --cache-from, --no-cache, --pull, --build-arg and BUILDKIT_INLINE_CACHE=1 depending on parameters like below?
Makes we wonder if we should instead of "prebuild the user's Dockerfile" turn the change around and "add features later".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted on the build args
Makes we wonder if we should instead of "prebuild the user's Dockerfile" turn the change around and "add features later".
I don't quite get what you mean here, do you mind elaborating how the features would be added later?
| Thank you for looking into this @chrmarti ! Will implement the changes requested and update the PR |
| Hi @chrmarti , I've added the requested changes.
Please let me know if you're happy with the change, then i can proceed to resolve any merge conflicts and proceed with any next steps suggested |
| Hi @chrmarti , hope you've had a nice weekend, have you had a chance to review this? |
| any updates on this? |
| @chrmarti any chance we can get this over the line soon? It's been 6 months on this PR and a year since microsoft/vscode-remote-release#6848. I am confident we agree that seeing that issue addressed would be ideal. Thanks in advance! |
| Hi @chrmarti it's been a little over a year since this pr last had activity. Is there anything we can do to help re-prioritize work on it. I've spoken to Abdullah and am happy to take over the PR and contribute to any ongoing change requests but I'm not sure this is actively being tracked atm. |
| Apologies for the delayed response. I'm a bit worried this will increase the complexity of the build code. Also note that using two Dockerfiles had the issues mentioned in microsoft/vscode-remote-release#6848 (comment). |
resolves microsoft/vscode-remote-release#6848
Changes
buildAndExtendDockerComposeto build the user specified Dockerfile and extend the image instead of extending the Dockerfile directlymore details in microsoft/vscode-remote-release#6848 (comment)
CC @chrmarti