-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile-extras
41 lines (25 loc) · 1.12 KB
/
Dockerfile-extras
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
33
34
35
36
37
38
39
40
41
# this is a "non-slim" Dockerfile including additional debug and support utilities
FROM golang:1.14.2-alpine3.11 AS build
WORKDIR /app
RUN apk add --no-cache --update build-base
COPY . .
RUN go build -o tupelo -v -a -gcflags=-trimpath="${PWD}" -asmflags=-trimpath="${PWD}" ./signer/ && \
mv ./tupelo /go/bin/tupelo
WORKDIR /app/signer/metrics
RUN go install -v -a -gcflags=-trimpath="${PWD}" -asmflags=-trimpath="${PWD}"
FROM alpine:3.11
LABEL maintainer="[email protected]"
RUN apk add --no-cache --update gettext ca-certificates curl libcap bash htop
RUN mkdir -p /tupelo
RUN addgroup -g 1000 tupelo && \
adduser -u 1000 -G tupelo -h /tupelo --disabled-password tupelo && \
chmod 0775 /tupelo && \
chgrp 0 /tupelo
COPY --from=build /go/bin/tupelo /usr/bin/tupelo
RUN setcap 'cap_net_bind_service=+ep' /usr/bin/tupelo
COPY ./docker/docker-entrypoint.sh /usr/bin/docker-entrypoint
RUN chmod +x /usr/bin/docker-entrypoint
COPY --chown=1000:0 ./docker/config.toml.tpl /tupelo/config.toml.tpl
COPY --from=build /go/bin/metrics /usr/bin/tupelo-net-metrics
USER tupelo
ENTRYPOINT ["/usr/bin/docker-entrypoint"]