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

dockerfile: move TARGET* args for fast workflow & ... #993

Merged
merged 2 commits into from
Sep 26, 2022
Merged
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
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ FROM --platform=$BUILDPLATFORM golang:1.18-alpine as BUILD

WORKDIR /relayer

ARG TARGETARCH
ARG TARGETOS

# Update and install needed deps prioir to installing the binary.
RUN apk update && \
apk --no-cache add make git build-base
apk --no-cache add make git build-base

# Copy go.mod and go.sum first and download for caching go modules
COPY go.mod go.mod
COPY go.sum go.sum
COPY go.mod go.sum ./

RUN go mod download

# Copy the files from host
COPY . .

RUN export GOOS=${TARGETOS} GOARCH=${TARGETARCH} && \
make install
ARG TARGETARCH TARGETOS
ENV GOOS=${TARGETOS} GOARCH=${TARGETARCH}
RUN make install

FROM alpine:latest

Expand Down