-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (20 loc) · 821 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (20 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Builder Image
# ---------------------------------------------------
FROM golang:1.25-alpine AS go-builder
ARG VERSION=dev \
COMMIT=none
WORKDIR /usr/src/app
COPY . ./
RUN go mod download \
&& CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT}" -trimpath -a -o main .
# Final Image
# ---------------------------------------------------
FROM dimaskiddo/alpine:base-glibc
MAINTAINER Dimas Restu Hidayanto <dimas.restu@student.upi.edu>
ARG SERVICE_NAME="dns-proxy"
ENV PATH $PATH:/usr/app/${SERVICE_NAME}
WORKDIR /usr/app/${SERVICE_NAME}
RUN apk --no-cache --update upgrade
COPY --from=go-builder /usr/src/app/main ./dns-proxy
COPY --from=go-builder /usr/src/app/dns-proxy.yaml.example ./dns-proxy.yaml
CMD ["dns-proxy", "-config", "./dns-proxy.yaml"]