mirror of
https://github.com/folbricht/routedns.git
synced 2025-12-17 15:45:21 -06:00
Add support for ARM in Dockerfile (#254)
* Add support for ARM in Dockerfile Create script dockerbuild.sh to check if the CPU is amd64,arm or arm64 so GOARCH can be dynamicly defined instead of hardcoding amd64 * Use case - esac * Add ARG GOARCH Add ARG GOARCH so when defined in `docker ----build-arg` it will compile to this target platform, otherwise use the arch defined by the build host. * Use simpler docker build command - Add GOOS=linux and GOARCH=amd64 in Dockerfile - Remove dockerbuild.sh * Use empty ARG values
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
FROM golang:alpine as builder
|
||||
ARG GOOS
|
||||
ARG GOARCH
|
||||
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
WORKDIR cmd/routedns
|
||||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build
|
||||
RUN GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build
|
||||
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /build/cmd/routedns/routedns .
|
||||
|
||||
Reference in New Issue
Block a user