Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 7c6107b

Browse files
author
Harmen
authored
Merge pull request #11 from dsw9742/dockerfile
adding Dockerfile for convenience
2 parents 2e4a99f + 49412a8 commit 7c6107b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# builder
2+
FROM golang:1.9.3-alpine3.7 AS builder
3+
4+
WORKDIR /go/src/github.com/alicebob
5+
6+
ARG ASPROM_VERSION=1.0.1
7+
8+
RUN apk add --no-cache git \
9+
&& git clone https://github.com/alicebob/asprom.git \
10+
&& cd asprom \
11+
&& git fetch --all --tags --prune \
12+
&& git checkout tags/$ASPROM_VERSION
13+
14+
WORKDIR /go/src/github.com/alicebob/asprom
15+
16+
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o asprom .
17+
18+
19+
20+
# final
21+
FROM alpine:3.7
22+
23+
RUN apk --no-cache add ca-certificates
24+
25+
WORKDIR /root/
26+
27+
COPY --from=builder /go/src/github.com/alicebob/asprom .
28+
29+
EXPOSE 9145
30+
31+
CMD ["./asprom"]

0 commit comments

Comments
 (0)