Skip to content

Commit

Permalink
Update Dockerfile platform specification
Browse files Browse the repository at this point in the history
  • Loading branch information
ykadowak committed Jan 23, 2024
1 parent 716a0bb commit 085f31e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dockers/gateway/mirror/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static
ARG DISTROLESS_IMAGE_TAG=nonroot
ARG MAINTAINER="vdaas.org vald team <[email protected]>"

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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dockers/index/job/readreplica/rotate/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static
ARG DISTROLESS_IMAGE_TAG=nonroot
ARG MAINTAINER="vdaas.org vald team <[email protected]>"

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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dockers/tools/benchmark/job/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ ARG DISTROLESS_IMAGE_TAG=nonroot
ARG UPX_OPTIONS=-9
ARG MAINTAINER="vdaas.org vald team <[email protected]>"

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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dockers/tools/benchmark/operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ ARG DISTROLESS_IMAGE_TAG=nonroot
ARG UPX_OPTIONS=-9
ARG MAINTAINER="vdaas.org vald team <[email protected]>"

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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 085f31e

Please sign in to comment.