Skip to content

Commit

Permalink
✨ Build on build platform (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone authored Jun 13, 2024
1 parent b65a6e6 commit 212fb30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ RUN set -eux && \
DISABLE_CGO=1 make bin/skopeo."${TARGETOS}"."${TARGETARCH}" && \
cp bin/skopeo."${TARGETOS}"."${TARGETARCH}" /tmp/skopeo

FROM golang:${GOLANG_VERSION} as builder
FROM --platform=$BUILDPLATFORM golang:${GOLANG_VERSION} as builder

ARG USE_MIRROR=false

RUN set -eux && \
if [ "$USE_MIRROR" = true ]; then sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories; fi && \
apk add --no-cache make bash ncurses build-base git openssl linux-headers
apk add --no-cache make bash ncurses git openssl

COPY . /go/src/github.com/go-sigma/sigma
COPY --from=web-builder /web/dist /go/src/github.com/go-sigma/sigma/web/dist
Expand Down
6 changes: 1 addition & 5 deletions build/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,16 @@ RUN set -eux && \
DISABLE_CGO=1 make bin/skopeo."${TARGETOS}"."${TARGETARCH}" && \
cp bin/skopeo."${TARGETOS}"."${TARGETARCH}" /tmp/skopeo

FROM golang:${GOLANG_VERSION} as builder
FROM --platform=$BUILDPLATFORM golang:${GOLANG_VERSION} as builder

ARG USE_MIRROR=false
ARG ZIG_VERSION=0.11.0
ARG BUILDARCH

RUN set -eux && \
if [ "$USE_MIRROR" = true ]; then sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list.d/debian.sources; fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
git \
wget \
xz-utils \
&& \
rm -rf /var/lib/apt/lists/*

Expand Down

0 comments on commit 212fb30

Please sign in to comment.