-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
39 lines (25 loc) · 948 Bytes
/
Dockerfile
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
FROM golang:1.14.2-alpine3.11 AS build
WORKDIR /app
RUN apk add --no-cache --update build-base
# cache dependencies
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -o tupelo -v -a -gcflags=-trimpath="${PWD}" -asmflags=-trimpath="${PWD}" ./signer/ && \
mv ./tupelo /go/bin/tupelo
FROM alpine:3.11
LABEL maintainer="[email protected]"
RUN apk add --no-cache --update gettext ca-certificates curl libcap
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
USER tupelo
ENTRYPOINT ["/usr/bin/docker-entrypoint"]