mirror of
https://github.com/folbricht/routedns.git
synced 2025-12-31 06:29:59 -06:00
* 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
16 lines
354 B
Docker
16 lines
354 B
Docker
FROM golang:alpine as builder
|
|
ARG GOOS
|
|
ARG GOARCH
|
|
|
|
WORKDIR /build
|
|
COPY . .
|
|
WORKDIR cmd/routedns
|
|
RUN GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build
|
|
|
|
FROM alpine:latest
|
|
COPY --from=builder /build/cmd/routedns/routedns .
|
|
COPY cmd/routedns/example-config/simple-dot-proxy.toml config.toml
|
|
EXPOSE 53/tcp 53/udp
|
|
ENTRYPOINT ["/routedns"]
|
|
CMD ["config.toml"]
|