From 085f31e17062373073377fcc70929051b2a16b41 Mon Sep 17 00:00:00 2001 From: "yusuke.kadowaki" Date: Tue, 23 Jan 2024 14:18:55 +0900 Subject: [PATCH] Update Dockerfile platform specification --- dockers/gateway/mirror/Dockerfile | 6 +++--- dockers/index/job/readreplica/rotate/Dockerfile | 6 +++--- dockers/tools/benchmark/job/Dockerfile | 6 +++--- dockers/tools/benchmark/operator/Dockerfile | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 9f837fedf1..58d41d32f1 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -19,9 +19,9 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM golang:${GO_VERSION} AS golang +FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang -FROM ubuntu:devel AS builder +FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH @@ -86,7 +86,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" -FROM ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer "${MAINTAINER}" ENV APP_NAME mirror diff --git a/dockers/index/job/readreplica/rotate/Dockerfile b/dockers/index/job/readreplica/rotate/Dockerfile index 1e062b91ca..d22f7a6e95 100644 --- a/dockers/index/job/readreplica/rotate/Dockerfile +++ b/dockers/index/job/readreplica/rotate/Dockerfile @@ -20,9 +20,9 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM golang:${GO_VERSION} AS golang +FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang -FROM ubuntu:devel AS builder +FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH @@ -87,7 +87,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME readreplica-rotate diff --git a/dockers/tools/benchmark/job/Dockerfile b/dockers/tools/benchmark/job/Dockerfile index 0f993334e3..acef095c7e 100644 --- a/dockers/tools/benchmark/job/Dockerfile +++ b/dockers/tools/benchmark/job/Dockerfile @@ -23,9 +23,9 @@ ARG DISTROLESS_IMAGE_TAG=nonroot ARG UPX_OPTIONS=-9 ARG MAINTAINER="vdaas.org vald team " -FROM golang:${GO_VERSION} AS golang +FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang -FROM ubuntu:devel AS builder +FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG UPX_OPTIONS ARG ZLIB_VERSION @@ -117,7 +117,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME job diff --git a/dockers/tools/benchmark/operator/Dockerfile b/dockers/tools/benchmark/operator/Dockerfile index b9771c9120..e629f68ca1 100644 --- a/dockers/tools/benchmark/operator/Dockerfile +++ b/dockers/tools/benchmark/operator/Dockerfile @@ -21,9 +21,9 @@ ARG DISTROLESS_IMAGE_TAG=nonroot ARG UPX_OPTIONS=-9 ARG MAINTAINER="vdaas.org vald team " -FROM golang:${GO_VERSION} AS golang +FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang -FROM ubuntu:devel AS builder +FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH @@ -92,7 +92,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME operator