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

Include multiarch buld into Docker #9

Closed
maltegrosse opened this issue Mar 11, 2021 · 1 comment
Closed

Include multiarch buld into Docker #9

maltegrosse opened this issue Mar 11, 2021 · 1 comment

Comments

@maltegrosse
Copy link

maltegrosse commented Mar 11, 2021

Would be nice to have build process included into the Dockerfile, for example:

ARG ARCH=amd64

# build stage
FROM golang:1.13 AS builder
RUN mkdir -p /go/src/app
WORKDIR /go/src/app
COPY . ./
RUN go mod download
RUN go mod verify
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$ARCH go build -a -o /app .


# final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=builder /app ./
RUN chmod +x ./app
ENTRYPOINT ["./app"]
EXPOSE 80
@joonas-fi
Copy link
Member

Our build tool actually already supported Docker multi-arch builds. I enabled the flag and now there's a Docker Hub image with multiple architectures

@joonas-fi joonas-fi mentioned this issue Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants