-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area/artifact-dependenciesbuild/dockerkind/bugSomething isn't workingSomething isn't workingpriority/p1High impact feature/bug.High impact feature/bug.
Description
The simple-artifact-dependency example is used to minimally reproduce an issue I experienced with dependency. Note that only two modifications are made to the app/Dockerfile. No other changes are made to any other file in the example.
Change
FROM $BASE
to
FROM $BASE AS foo
and add
FROM foo AS bar
to the end of the file
Expected behavior
Generating tags...
- app -> app:v1.20.0-33-g2e55bec5d-dirty
- base -> base:v1.20.0-33-g2e55bec5d
Checking cache...
- app: Not found. Building
- base: Not found. Building
Found [docker-desktop] context, using local docker daemon.
Building [base]...
Sending build context to Docker daemon 3.072kB
[snip]
Successfully built b9603d54eab5
Successfully tagged app:v1.20.0-33-g2e55bec5d-dirty
Actual behavior
Generating tags...
- app -> app:v1.20.0-33-g2e55bec5d-dirty
- base -> base:v1.20.0-33-g2e55bec5d
Checking cache...
- app: Error checking cache.
getting hash for artifact "app": getting dependencies for "app": parsing ONBUILD instructions: retrieving image "foo": GET https://index.docker.io/v2/library/foo/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/foo Type:repository]]
Information
- Skaffold version: v1.20.0
- Operating system: Windows Version 1903 (OS Build 18362.1256)
- Docker Desktop 3.1.0 (51484)
- Docker Engine: 20.10.2
- Installed via: Chocolatey
- Contents of skaffold.yaml:
apiVersion: skaffold/v2beta12
kind: Config
build:
artifacts:
- image: app
context: app
requires:
- image: base
alias: BASE
- image: base
context: base
deploy:
kubectl:
manifests:
- app/k8s-pod.yaml
- Contents of app/Dockerfile
ARG BASE
FROM golang:1.15 as builder
COPY main.go .
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
ARG SKAFFOLD_GO_GCFLAGS
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /app .
FROM $BASE AS foo
# Define GOTRACEBACK to mark this container as using the Go language runtime
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/).
ENV GOTRACEBACK=single
CMD ["./app"]
COPY --from=builder /app .
FROM foo AS bar
Steps to reproduce the behavior
git clone https://github.com/GoogleContainerTools/skaffold.git
cd skaffold/examples/simple-artifact-dependency
- Edit app/Dockerfile as specified above.
skaffold build -vtrace
time="2021-03-06T00:06:42-06:00" level=info msg="Skaffold &{Version:v1.20.0 ConfigVersion:skaffold/v2beta12 GitVersion: GitCommit:c48e97690d8daffd68141c2a68fcbe3df6f6936a GitTreeState:dirty BuildDate:2021-02-11T22:56:45Z GoVersion:go1.14.14 Compiler:gc Platform:windows/amd64}"
time="2021-03-06T00:06:42-06:00" level=debug msg="Update check not enabled, skipping."
time="2021-03-06T00:06:42-06:00" level=debug msg="parsed 1 configs from configuration file D:\\git\\skaffold\\examples\\simple-artifact-dependency\\skaffold.yaml"
time="2021-03-06T00:06:42-06:00" level=info msg="Loaded Skaffold defaults from \"C:\\\\Users\\\\daniel.barnes\\\\.skaffold\\\\config\""
time="2021-03-06T00:06:42-06:00" level=debug msg="Defaulting build type to local build"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct SkaffoldConfig"
time="2021-03-06T00:06:42-06:00" level=debug msg="found config for context \"docker-desktop\""
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct Metadata"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct Pipeline"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct BuildConfig"
time="2021-03-06T00:06:42-06:00" level=debug msg="could not parse date \"\""
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct Artifact"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct ArtifactType"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct DockerArtifact"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct ArtifactDependency"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct Artifact"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct ArtifactType"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct DockerArtifact"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct TagPolicy"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct GitTagger"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct BuildType"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct LocalBuild"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct DeployConfig"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct DeployType"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct KubectlDeploy"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct KubectlFlags"
time="2021-03-06T00:06:42-06:00" level=trace msg="validating yamltags of struct LogsConfig"
time="2021-03-06T00:06:42-06:00" level=info msg="Using kubectl context: docker-desktop"
time="2021-03-06T00:06:42-06:00" level=trace msg="Minikube cluster not detected: unable to find minikube executable. Please add it to PATH environment variable"
time="2021-03-06T00:06:42-06:00" level=debug msg="setting Docker user agent to skaffold-v1.20.0"
time="2021-03-06T00:06:42-06:00" level=debug msg="Using builder: local"
time="2021-03-06T00:06:42-06:00" level=debug msg="push value not present, defaulting to false because cluster.PushImages is false"
Generating tags...
- app -> time="2021-03-06T00:06:42-06:00" level=debug msg="Running command: [git describe --tags --always]"
time="2021-03-06T00:06:42-06:00" level=debug msg="Running command: [git describe --tags --always]"
time="2021-03-06T00:06:42-06:00" level=debug msg="Command output: [v1.20.0-33-g2e55bec5d\n]"
time="2021-03-06T00:06:42-06:00" level=debug msg="Command output: [v1.20.0-33-g2e55bec5d\n]"
time="2021-03-06T00:06:42-06:00" level=debug msg="Running command: [git status . --porcelain]"
time="2021-03-06T00:06:42-06:00" level=debug msg="Running command: [git status . --porcelain]"
time="2021-03-06T00:06:43-06:00" level=debug msg="Command output: [ M examples/simple-artifact-dependency/app/Dockerfile\n]"
app:v1.20.0-33-g2e55bec5d-dirty
- base -> time="2021-03-06T00:06:43-06:00" level=debug msg="Command output: []"
base:v1.20.0-33-g2e55bec5d
time="2021-03-06T00:06:43-06:00" level=info msg="Tags generated in 736.0178ms"
Checking cache...
time="2021-03-06T00:06:43-06:00" level=trace msg="Checking base image alpine:3 for ONBUILD triggers."
time="2021-03-06T00:06:43-06:00" level=trace msg="Checking base image golang:1.15 for ONBUILD triggers."
time="2021-03-06T00:06:43-06:00" level=debug msg="Found dependencies for dockerfile: [{hello.txt / true}]"
time="2021-03-06T00:06:43-06:00" level=debug msg="push value not present, defaulting to false because cluster.PushImages is false"
time="2021-03-06T00:06:43-06:00" level=trace msg="Checking base image foo for ONBUILD triggers."
- app: Error checking cache.
getting hash for artifact "app": getting dependencies for "app": parsing ONBUILD instructions: retrieving image "foo": GET https://index.docker.io/v2/library/foo/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/foo Type:repository]]
Additional Information
- The build succeeds if the
FROM foo AS bar
line is removed from app/Dockerfile. - The build succeeds if
--cache-artifacts=false
is specified. - The following succeeds without error:
docker build -t base base
docker build --build-arg BASE=base -t app app
Metadata
Metadata
Assignees
Labels
area/artifact-dependenciesbuild/dockerkind/bugSomething isn't workingSomething isn't workingpriority/p1High impact feature/bug.High impact feature/bug.