We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50ffe53 commit d9e191aCopy full SHA for d9e191a
1 file changed
Dockerfile
@@ -0,0 +1,32 @@
1
+FROM golang:1.14 AS builder
2
+
3
+# Set necessary environmet variables needed for our image
4
+ENV CGO_ENABLED=1 \
5
+ GOOS=linux \
6
+ GOARCH=arm64
7
8
+# Move to working directory /build
9
+WORKDIR /build
10
11
+# Copy the code into the container
12
+COPY . .
13
14
+# Build the application
15
+RUN go build -v -a -tags netgo -ldflags '-w -extldflags "-static"' .
16
17
+# Move to /dist directory as the place for resulting binary folder
18
+WORKDIR /dist
19
20
+# Copy binary from build to main folder
21
+RUN cp /build/github2telegram .
22
23
+# Build a small image
24
+FROM scratch
25
26
+WORKDIR /app
27
28
+COPY ca-certificates.crt /etc/ssl/certs/ca-certificates.pem
29
+COPY --from=builder /dist/github2telegram /app
30
31
+# Command to run
32
+ENTRYPOINT ["/app/github2telegram"]
0 commit comments