forked from snagles/docker-registry-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (29 loc) · 1.17 KB
/
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
# 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/hjochman/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/hjochman/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
RUN apk add --no-cache curl
# Copy packed beego tar
WORKDIR /app
COPY --from=build-env /app /app
COPY --from=build-env /go/src/github.com/hjochman/docker-registry-manager/registries.yml /app/registries.yml
COPY app/ibmcloud-list.sh /bin/ibmcloud-list.sh
RUN chmod +x /bin/ibmcloud-list.sh
RUN curl -fsSL https://clis.cloud.ibm.com/install/linux | /bin/sh
RUN ibmcloud plugin install container-registry
# 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"]