forked from notaryproject/notary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.Dockerfile
35 lines (24 loc) · 954 Bytes
/
server.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
FROM golang:1.14.1-alpine
RUN apk add --update git gcc libc-dev
RUN addgroup --system notary && adduser --system --ingroup notary --uid 999 notary
USER notary
ENV GO111MODULE=on
ARG MIGRATE_VER=v4.6.2
RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/v4/cli@${MIGRATE_VER} && mv /go/bin/cli /go/bin/migrate
ENV GOFLAGS=-mod=vendor
ENV NOTARYPKG github.com/autonomic-ai/notary
# Copy the local repo to the expected go path
COPY . /go/src/${NOTARYPKG}
WORKDIR /go/src/${NOTARYPKG}
ENV SERVICE_NAME=notary_server
EXPOSE 4443
# Install notary-server
RUN go install \
-tags pkcs11 \
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" \
${NOTARYPKG}/cmd/notary-server
USER root
RUN apk del git gcc libc-dev && rm -rf /var/cache/apk/*
USER notary
ENTRYPOINT [ "notary-server" ]
CMD [ "-config=fixtures/server-config-local.json" ]