compose build.context.additional_contexts should support another service image as the base image
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- docker-compose, go
- Domain
- build-system, cli
Research direction
Start with the nerdctl compose build path and its handling of build.additional_contexts, using the supplied service:base example as the reproduction. Compare its resolution with Docker Compose's documented dependent-image behavior and verify that the dependent base image can be used as base_image without the shown local-path error.
Written by the indexing model from the issue text.
Description
What is the problem you're trying to solve
I tried following example
services:
base:
image: base
build:
context: .
dockerfile: Base.containerfile
my-service:
image: base
build:
context: .
dockerfile: Service1.containerfile
additional_contexts:
base_image: service:base
[root@nginxunitlia test]# nerdctl compose build
INFO[0000] Building image base
[+] Building 2.8s (5/5) FINISHED
=> [internal] load build definition from Base.containerfile 0.0s
=> => transferring dockerfile: 121B 0.0s
=> [internal] load metadata for docker.io/library/almalinux:9 1.7s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/1] FROM docker.io/library/almalinux:9@sha256:e781633da358ff79d6ad69a080cfacbff5edd7f66473bcbd31105d1f2d977e5b 0.5s
=> => resolve docker.io/library/almalinux:9@sha256:e781633da358ff79d6ad69a080cfacbff5edd7f66473bcbd31105d1f2d977e5b 0.0s
=> => sha256:0f8a51a00283c0f5f6a29f00f346ec8ff4bc9349b54a5531d64e5065c576ac21 69.77MB / 69.77MB 0.5s
=> exporting to docker image format 1.0s
=> => exporting layers 0.0s
=> => exporting manifest sha256:e639a26a3199572d52498eb335e06e2da97499ef72c586bc3b9dc6e7f0be262f 0.0s
=> => exporting config sha256:ffbfe0e93c2675800088cc4ee24e58c71f9173a9df8dca942cd3977cf0739e69 0.0s
=> => sending tarball 0.5s
unpacking docker.io/library/base:latest (sha256:e639a26a3199572d52498eb335e06e2da97499ef72c586bc3b9dc6e7f0be262f)...
Loaded image: docker.io/library/base:latest
INFO[0005] Building image base
error: invalid local: resolve : lstat /root/containers/test/service:base: no such file or directory
FATA[0000] no image was built
FATA[0005] error while building image base: exit status 1
Describe the solution you'd like
To work like docker compose
Additional context
[root@nginxunitlia test]# nerdctl --version
nerdctl version 2.1.2
- Dominant language
- Go
- Stars
- 10.5k
- Forks
- 853
- Avg merge
- 6d 14h
- Merged PRs (30d)
- 38
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containerd/nerdctl
-
Test and examples: update wordpress images (to silence potential false security alerts)Possibly taken @Guurdeep claimed this 20 days ago. Openarea/ci documentation priority/low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
containerd/nerdctl#5283 · 2 comments ·
Maintainers usually reply within 3 days
-
`nerdctl kill` shouldn't set `containerd.io/restart.explicitly-stopped` label for non-stop signalsMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
containerd/nerdctl#5171 · 3 comments ·
Maintainers usually reply within 3 days
-
area/project
Difficulty 1/5 Under an hour Newbie friendliness 25/100
containerd/nerdctl#5383 · 5 comments ·
Maintainers usually reply within 3 days
-
Restart-policy containers loop on "unable to apply apparmor profile" after reboot until the creating user logs in (OCI hook inherits the client's XDG_RUNTIME_DIR)Possibly taken @Shubhranshu153 claimed this today. Openarea/rootless bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
containerd/nerdctl#5377 · 1 assignee ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
containerd/nerdctl#5355 ·
Maintainers usually reply within 3 days
All issues in containerd/nerdctl
Similar issues
-
P3 tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
kind/feature needs-triage priority/unprioritized
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA/k8s-test-infra#1504 ·
Maintainers usually reply within 1 day
-
Area/Infrastructure Aspect/Infra Resources Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wso2/agent-manager#2717 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
open-policy-agent/opa#9685 · 1 comment ·
Maintainers usually reply within 1 day