Skip to content

Commit 1dacdb9

Browse files
committed
refactor: simple artifact example
To show/reproduce, check in tests & confirm fix for issue ##9830 Before: ``` $ ./skaffold build Generating tags... - app -> localhost:32000/app:latest - base -> localhost:32000/base:f06ab6582db5b2f039bbfe557419b897c31a4161c69c6e7c7832f839b021a7e4 Some taggers failed. Rerun with -vdebug for errors. Checking cache... - app: Not found. Building - base: Found Remotely Starting build... After: ``` $ ../../out/skaffold build Generating tags... - app -> localhost:32000/app:6e10fde24150d5d16ab976db4d4f5a479522d3f82aa38606b7f15e1aef18be00 - base -> localhost:32000/base:f06ab6582db5b2f039bbfe557419b897c31a4161c69c6e7c7832f839b021a7e4 Checking cache... - app: Found. Tagging - base: Found Remotely ```
1 parent 39c7f09 commit 1dacdb9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
ARG BASE
2-
FROM golang:1.18 as builder
2+
3+
FROM golang:1.18 AS builder
34
WORKDIR /code
45
COPY main.go .
56
COPY go.mod .
67
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
78
ARG SKAFFOLD_GO_GCFLAGS
89
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -trimpath -o /app .
910

10-
FROM $BASE
11+
FROM $BASE AS base
12+
13+
FROM scratch
1114
# Define GOTRACEBACK to mark this container as using the Go language runtime
1215
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/).
1316
ENV GOTRACEBACK=single
1417
CMD ["./app"]
1518
COPY --from=builder /app .
19+
COPY --from=base hello.txt .
20+

examples/simple-artifact-dependency/skaffold.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ build:
99
alias: BASE
1010
- image: base
1111
context: base
12+
tagPolicy:
13+
inputDigest: {}
1214
manifests:
1315
rawYaml:
1416
- app/k8s-pod.yaml

0 commit comments

Comments
 (0)