Files
routedns/Dockerfile
mrmenndev 621bd1914f 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
2022-09-01 08:40:49 +02:00

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"]