Skip to content

Commit b058f84

Browse files
authored
Updating code for leaner automated builds.
1 parent c23878f commit b058f84

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
FROM golang:alpine as build
2-
ENV RELEASE_TAG 2.1.15
1+
FROM golang:alpine AS build
2+
3+
ARG RELEASE_TAG=2.1.15
4+
ENV RELEASE_TAG=$RELEASE_TAG
5+
36
RUN apk --no-cache add git && \
4-
git clone https://github.com/jedisct1/dnscrypt-proxy /go/src/github.com/jedisct1/ && \
5-
cd /go/src/github.com/jedisct1/dnscrypt-proxy && \
6-
git checkout tags/${RELEASE_TAG} && \
7+
git clone --depth 1 --branch "${RELEASE_TAG}" https://github.com/DNSCrypt/dnscrypt-proxy.git /src && \
8+
cd /src && \
79
CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-s -w -extldflags "-static"' -v ./...
810

911
FROM alpine
12+
1013
RUN apk --no-cache add ca-certificates
14+
1115
COPY --from=build /go/bin/dnscrypt-proxy /usr/local/bin/dnscrypt-proxy
16+
1217
ADD config /config
18+
1319
EXPOSE 53/udp
1420

1521
CMD ["dnscrypt-proxy", "-config", "/config/dnscrypt-proxy.toml"]
22+

0 commit comments

Comments
 (0)