-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
35 lines (23 loc) · 1.13 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
# Build Stage
FROM golang:1.12.4 AS build-stage
LABEL app="build-networkmachinery-operators"
LABEL REPO="https://github.com/networkmachinery/networkmachinery-operators"
ENV PROJPATH=/go/src/github.com/networkmachinery/networkmachinery-operators
# Because of https://github.com/docker/docker/issues/14914
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
ADD . /go/src/github.com/networkmachinery/networkmachinery-operators
WORKDIR /go/src/github.com/networkmachinery/networkmachinery-operators
RUN make build-alpine
# Final Stage
FROM debian:stretch-slim
ARG GIT_COMMIT
ARG VERSION
LABEL REPO="https://github.com/networkmachinery/networkmachinery-operators"
LABEL GIT_COMMIT=$GIT_COMMIT
LABEL VERSION=$VERSION
# Because of https://github.com/docker/docker/issues/14914
ENV PATH=$PATH:/opt/networkmachinery-operators/bin
WORKDIR /opt/networkmachinery-operators/bin
COPY --from=build-stage /go/src/github.com/networkmachinery/networkmachinery-operators/bin/networkmachinery-hyper /opt/networkmachinery-operators/bin/
RUN chmod +x /opt/networkmachinery-operators/bin/networkmachinery-hyper
ENTRYPOINT ["/opt/networkmachinery-operators/bin/networkmachinery-hyper"]