forked from SUSE/registries-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (30 loc) · 1.09 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
38
39
40
#
# Dockerfile for generating an official image
# (see Dockerfile.local if you want something
# faster for development)
#
FROM opensuse/leap:15.0 as builder
ARG BUILD_DIR="/go/src/github.com/kubic-project/registries-operator"
# Copy stuff to the image...
# (check the .dockerignore file for exclusions)
ADD . $BUILD_DIR
WORKDIR $BUILD_DIR
RUN zypper ar https://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Leap_15.0/devel:languages:go.repo
RUN zypper --non-interactive --no-gpg-checks ref
RUN zypper in -y make git go
RUN go version
ENV GOPATH="/go"
ENV GOBIN="/go/bin"
ENV PATH="/usr/bin:/bin:/usr/local/bin:/go/bin"
RUN mkdir -p $GOBIN
RUN make -C $BUILD_DIR clean
RUN make -C $BUILD_DIR all
####################
# final stage
####################
FROM opensuse/leap:15.0
ARG BUILD_DIR="/go/src/github.com/kubic-project/registries-operator"
ARG BUILT_EXE="cmd/registries-operator/registries-operator"
COPY --from=builder $BUILD_DIR/$BUILT_EXE /usr/local/bin/registries-operator
RUN chmod 755 /usr/local/bin/registries-operator
CMD ["/usr/local/bin/registries-operator"]