Skip to content

Commit

Permalink
specify architecture-specific images to prevent race conditions with …
Browse files Browse the repository at this point in the history
…runtime images

Signed-off-by: Jake Sanders <jsand@google.com>
  • Loading branch information
Jake Sanders committed Nov 2, 2021
1 parent aaa14d9 commit 15b0101
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
24 changes: 12 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ dockers:
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
# TODO(dekkagaijin): remove suffix when race condition fixed
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}-amd64"
- "--build-arg=TARGETARCH=amd64"
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/cosign:{{ .Version }}-arm64v8"
Expand All @@ -182,8 +182,8 @@ dockers:
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
# TODO(dekkagaijin): remove suffix when race condition fixed
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}-arm64"
- "--build-arg=TARGETARCH=arm64"

# cosigned Image
Expand All @@ -194,8 +194,8 @@ dockers:
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
# TODO(dekkagaijin): remove suffix when race condition fixed
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}-amd64"
- "--build-arg=TARGETARCH=amd64"
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/cosigned:{{ .Version }}-arm64v8"
Expand All @@ -204,8 +204,8 @@ dockers:
dockerfile: Dockerfile.cosigned
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
# TODO(dekkagaijin): remove suffix when race condition fixed
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}-arm64"
- "--build-arg=TARGETARCH=arm64"

# sget Image
Expand All @@ -216,8 +216,8 @@ dockers:
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
# TODO(dekkagaijin): remove suffix when race condition fixed
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}-amd64"
- "--build-arg=TARGETARCH=amd64"
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/sget:{{ .Version }}-arm64v8"
Expand All @@ -226,8 +226,8 @@ dockers:
dockerfile: Dockerfile.sget
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
# TODO(dekkagaijin): remove suffix when race condition fixed
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}-arm64"
- "--build-arg=TARGETARCH=arm64"

docker_manifests:
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
# limitations under the License.

ARG RUNTIME_IMAGE=gcr.io/distroless/base:debug
ARG TARGETARCH

FROM --platform=linux/${TARGETARCH} $RUNTIME_IMAGE
FROM $RUNTIME_IMAGE

ARG TARGETARCH
COPY cosign-linux-${TARGETARCH} /bin/cosign
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile.cosigned
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
# limitations under the License.

ARG RUNTIME_IMAGE=gcr.io/distroless/base:debug
ARG TARGETARCH

FROM --platform=linux/${TARGETARCH} $RUNTIME_IMAGE
FROM $RUNTIME_IMAGE

ARG TARGETARCH
COPY cosigned-linux-${TARGETARCH} /bin/cosigned
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile.sget
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
# limitations under the License.

ARG RUNTIME_IMAGE=gcr.io/distroless/base:debug
ARG TARGETARCH

FROM --platform=linux/${TARGETARCH} $RUNTIME_IMAGE
FROM $RUNTIME_IMAGE

ARG TARGETARCH
COPY sget-linux-${TARGETARCH} /bin/sget
Expand Down

0 comments on commit 15b0101

Please sign in to comment.