-
Notifications
You must be signed in to change notification settings - Fork 58
/
Dockerfile
31 lines (24 loc) · 966 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
# Start from an Alpine image with the latest version of Go installed
FROM golang:alpine as build-env
# Install git and the bee tool used for deployment
RUN apk add --no-cache git
# Copy the local package files to the container's workspace.
ADD . /go/src/github.com/snagles/docker-registry-manager
# Build the application using the bee tool
RUN go get github.com/beego/bee
RUN bee pack -p /go/src/github.com/snagles/docker-registry-manager/app
RUN mkdir /app
RUN tar -xzvf /go/app.tar.gz --directory /app
# Distributed image
FROM alpine:3.7
RUN apk add --no-cache ca-certificates
# Copy packed beego tar
WORKDIR /app
COPY --from=build-env /app /app
COPY --from=build-env /go/src/github.com/snagles/docker-registry-manager/registries.yml /app/registries.yml
# Set the default registries location and volume
ENV MANAGER_REGISTRIES=/app/registries.yml
ENV MANAGER_LOG_LEVEL=warn
VOLUME ["/app"]
# Run the app by default when the container starts
CMD ["/app/app"]