Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the release #987

Merged
merged 4 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add platform flag to Dockerfiles, explicitly state TARGETARCH for gor…
…eleaser

Signed-off-by: Jake Sanders <jsand@google.com>
  • Loading branch information
Jake Sanders committed Nov 2, 2021
commit aaa14d9f382a83fe4c2215386fcb8832972bc6fd
24 changes: 18 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,55 +168,67 @@ dockers:
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/cosign:{{ .Version }}-amd64"
dockerfile: Dockerfile
goos: linux
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
- "--build-arg=ARCH=amd64"
- "--build-arg=TARGETARCH=amd64"
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/cosign:{{ .Version }}-arm64v8"
goos: linux
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
- "--build-arg=ARCH=arm64"
- "--build-arg=TARGETARCH=arm64"

# cosigned Image
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/cosigned:{{ .Version }}-amd64"
dockerfile: Dockerfile.cosigned
goos: linux
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
- "--build-arg=ARCH=amd64"
- "--build-arg=TARGETARCH=amd64"
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/cosigned:{{ .Version }}-arm64v8"
goos: linux
goarch: arm64
dockerfile: Dockerfile.cosigned
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
- "--build-arg=ARCH=arm64"
- "--build-arg=TARGETARCH=arm64"

# sget Image
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/sget:{{ .Version }}-amd64"
dockerfile: Dockerfile.sget
goos: linux
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
- "--build-arg=ARCH=amd64"
- "--build-arg=TARGETARCH=amd64"
- image_templates:
- "gcr.io/{{ .Env.PROJECT_ID }}/sget:{{ .Version }}-arm64v8"
goos: linux
goarch: arm64
dockerfile: Dockerfile.sget
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--no-cache"
- "--build-arg=RUNTIME_IMAGE={{ .Env.RUNTIME_IMAGE }}"
- "--build-arg=ARCH=arm64"
- "--build-arg=TARGETARCH=arm64"

docker_manifests:
- name_template: gcr.io/{{ .Env.PROJECT_ID }}/cosign:{{ .Version }}
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

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

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

ARG ARCH
COPY cosign-linux-${ARCH} /bin/cosign
ARG TARGETARCH
COPY cosign-linux-${TARGETARCH} /bin/cosign

USER nobody
ENTRYPOINT [ "/bin/cosign" ]
7 changes: 4 additions & 3 deletions Dockerfile.cosigned
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

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

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

ARG ARCH
COPY cosigned-linux-${ARCH} /bin/cosigned
ARG TARGETARCH
COPY cosigned-linux-${TARGETARCH} /bin/cosigned

USER nobody
ENTRYPOINT [ "/bin/cosigned" ]
7 changes: 4 additions & 3 deletions Dockerfile.sget
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

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

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

ARG ARCH
COPY sget-linux-${ARCH} /bin/sget
ARG TARGETARCH
COPY sget-linux-${TARGETARCH} /bin/sget

USER nobody
ENTRYPOINT [ "/bin/sget" ]