fix: default to legacy builder instead of BuildKit with podman#900
fix: default to legacy builder instead of BuildKit with podman#900eqladios wants to merge 1 commit intodevcontainers:mainfrom
Conversation
|
@microsoft-github-policy-service agree |
samruddhikhandale
left a comment
There was a problem hiding this comment.
Looks good to me, looping in @chrmarti for extra 👀
chrmarti
left a comment
There was a problem hiding this comment.
Should this only target the compose case?
I believe this would still fail with cli/src/spec-node/singleContainer.ts Lines 190 to 211 in 9ba1fda I guess I can add the check for podman in these lines and the compose lines instead, thought to short-circuit it from the also maybe I'm missing it but is there a way to define |
48be600 to
3a80b14
Compare
- Podman doesn't support all buildkit features. - Podman main branch is now always defaulting to "DOCKER_BUILDKIT=0", See https://github.com/containers/podman/blob/f7be7a365ad3e90db5f96f269a555f6f380f9275/cmd/podman/compose.go#L164 - fix: make cli ignore `--buildkit` parameter and default to `never` when Podman is used.
3a80b14 to
8afbc9c
Compare
|
With Podman 4.5.1 I see buildah 1.30 with |
@chrmarti sorry didn't get to check this again, I believe I was testing with podman 5+ and it was failing, anyway I'll try to check it again soon with podman and update this accordingly |
Description
Podman doesn't support buildkit and defaults to "DOCKER_BUILDKIT=0", See https://github.com/containers/podman/blob/f7be7a365ad3e90db5f96f269a555f6f380f9275/cmd/podman/compose.go#L157-L170
This results in Podman failing builds when
BUILDKIT_INLINE_CACHEoradditional_contextsis used, as for example incli/src/spec-node/dockerCompose.ts
Lines 230 to 245 in 9ba1fda
A simple fix would to make cli ignore
--buildkitparameter, default toneverand log a warning when Podman is used.Fixes #863
Testing
A failing example would be
Dockerfile
devcontainer.json
{ "name": "app", "dockerComposeFile": "compose.yaml", "service": "rails-app", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "features": { "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/rails/devcontainer/features/sqlite3": {} }, "containerUser": "vscode", "updateRemoteUserUID": true, "containerEnv": { "REDIS_URL": "redis://redis:6379/1", "HOME": "/home/vscode" }, "forwardPorts": [3000, 6379], "postCreateCommand": "bin/setup" }compose.yaml
when features is used in
devcontainer.jsonthis would always fail with logthe classic builder doesn't support additional contexts, set DOCKER_BUILDKIT=1 to use BuildKitI have compiled this on my machine and used it with
--buildkit autoand--buildkit noneand it works correctly and tests are passing normally, maybe an additional testing can be added for this.