You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM golang as base
FROM base as foo
RUN echo "foo"
FROM base as local
COPY . /go/src/go-test/
RUN go build /go/src/go-test/main.go
Building with podman build --target local . I would expect to just build the stages that are needed for the local stage (and not the foo stage). Maybe I'm misunderstanding how this works, but from #2469 I thought it would behave like Docker, and that it would skip the stages that are not needed for the build.
Steps to reproduce the issue:
Create a multi-stage Dockerfile
Build the Dockerfile with --target parameter
Describe the results you received:
❯ podman build --target local .
[1/3] STEP 1/1: FROM golang AS base
--> 26b88b86d19
[3/3] STEP 1/3: FROM 26b88b86d196c85f18b7a014d9d6a0e449e5d60dbd5a46af56289e711bbc8d37 AS local
[3/3] STEP 2/3: COPY . /go/src/go-test/
--> eb34f827f3d
[3/3] STEP 3/3: RUN go build /go/src/go-test/main.go
[3/3] COMMIT
--> e10acebc5fa
[2/3] STEP 1/2: FROM 26b88b86d196c85f18b7a014d9d6a0e449e5d60dbd5a46af56289e711bbc8d37 AS foo
[2/3] STEP 2/2: RUN echo "foo"
foo
--> fe9ccbf8966
e10acebc5fa6259e505f6cf30ca8b5494bad766e6d12fa18b3caf1b0adaa746a
Describe the results you expected:
❯ podman build --target local .
[1/3] STEP 1/1: FROM golang AS base
--> 26b88b86d19
[3/3] STEP 1/3: FROM 26b88b86d196c85f18b7a014d9d6a0e449e5d60dbd5a46af56289e711bbc8d37 AS local
[3/3] STEP 2/3: COPY . /go/src/go-test/
--> eb34f827f3d
[3/3] STEP 3/3: RUN go build /go/src/go-test/main.go
[3/3] COMMIT
--> e10acebc5fa
Output of podman version if reporting a podman build issue:
❯ podman version
Client: Podman Engine
Version: 4.2.0
API Version: 4.2.0
Go Version: go1.18.5
Built: Wed Aug 10 13:46:05 2022
OS/Arch: darwin/arm64
Server: Podman Engine
Version: 4.1.1
API Version: 4.1.1
Go Version: go1.18.4
Built: Fri Jul 22 12:06:49 2022
OS/Arch: linux/arm64
Output of uname -a:
Darwin WC14D5QQWT 21.6.0 Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:22 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered:
The Server is based on Fedora CoreOS which only updates every couple of weeks on released version. So it might not be out for a week or so.
Reopen if/when the podman 4.2 version on the server breaks.
Description
This is an example of a Dockerfile:
Building with
podman build --target local .
I would expect to just build the stages that are needed for thelocal
stage (and not thefoo
stage). Maybe I'm misunderstanding how this works, but from #2469 I thought it would behave like Docker, and that it would skip the stages that are not needed for the build.Steps to reproduce the issue:
--target
parameterDescribe the results you received:
Describe the results you expected:
Output of
podman version
if reporting apodman build
issue:Output of
uname -a
:The text was updated successfully, but these errors were encountered: