/
Dockerfile.edge-cloud
98 lines (85 loc) · 3.8 KB
/
Dockerfile.edge-cloud
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#
# docker build -t mobiledgex/edge-cloud -f Dockerfile.edge-cloud .
# docker run -it --rm mobiledgex/edge-cloud
# entry point here is bash. Inside docker ls /go/bin, you will
# see protoc-gen-gomex
# This is just a starting point. It let's you compile Go code here.
# Once service is coded, entry point will point to service.
# Also, please see Dockderfile.protoc. That one will let you
# create the protocol buffer stubs from proto files.
# All the tools will be inside the docker.
#
FROM registry.mobiledgex.net:5000/mobiledgex/build:go1.12.1 AS build
ENV GOPATH=/go
ENV PATH="/go/bin:${PATH}"
ENV GO111MODULE=on
ENV DOCKER_BUILD=yes
# Install support tools for docs
RUN go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.3.0
COPY --from=registry.mobiledgex.net:5000/mobiledgex/protoc-gen-swagger:2020-01-19 /build/bin/protoc-gen-swagger /go/bin
WORKDIR /go/src/github.com/mobiledgex
# Do dependencies first so they can be cached
COPY edge-cloud/go.mod edge-cloud/go.mod
COPY edge-cloud/go.sum edge-cloud/go.sum
COPY edge-cloud/Makefile.tools edge-cloud/Makefile.tools
COPY edge-cloud-infra/go.mod edge-cloud-infra/go.mod
COPY edge-cloud-infra/go.sum edge-cloud-infra/go.sum
WORKDIR /go/src/github.com/mobiledgex/edge-cloud
RUN go mod download
RUN make -f Makefile.tools
WORKDIR /go/src/github.com/mobiledgex/edge-cloud-infra
RUN go mod download
WORKDIR /go/src/github.com/mobiledgex
COPY edge-cloud edge-cloud
COPY edge-cloud-infra edge-cloud-infra
COPY edge-proto edge-proto
WORKDIR /go/src/github.com/mobiledgex/edge-cloud-infra
ENV CGO_ENABLED=1
RUN make
# Buld the docs
WORKDIR /go/src/github.com/mobiledgex/edge-cloud-infra
COPY --from=registry.mobiledgex.net:5000/mobiledgex/swagger:2020-03-12 /swagger /go/bin/swagger
RUN make doc
WORKDIR /go/src/github.com/mobiledgex/edge-cloud
RUN make doc
RUN make external-doc
RUN make -C d-match-engine/dme-proto external-swagger
FROM registry.mobiledgex.net:5000/mobiledgex/edge-cloud-base-image:v0.0.14-339-g20a71c7
# Will be overridden during build from the command line
ARG BUILD_TAG=latest
ADD edge-cloud/docker/mex-docker.env /root/mex-docker.env
ADD edge-cloud/docker/edge-cloud-entrypoint.sh /usr/local/bin
ADD edge-cloud/docker/vault-cert /usr/local/bin
ADD edge-cloud/docker/test-edgectl.sh /usr/local/bin
ADD edge-cloud/tls/out/mex-ca.crt /root/tls/mex-ca.crt
ADD edge-cloud/tls/out/mex-server.crt /root/tls/mex-server.crt
ADD edge-cloud/tls/out/mex-server.key /root/tls/mex-server.key
ADD edge-cloud/docker/beredgecloudtelekomde.crt /root/.mobiledgex/beredgecloudtelekomde.crt
ADD edge-cloud/docker/bonnedgecloudtelekomde.crt /root/.mobiledgex/bonnedgecloudtelekomde.crt
ADD edge-cloud/docker/fraedgecloudtelekomde.crt /root/.mobiledgex/fraedgecloudtelekomde.crt
ADD edge-cloud/docker/telesec_chain.crt /root/.mobiledgex/telesec_chain.crt
RUN chmod +x /usr/local/bin/edge-cloud-entrypoint.sh \
/usr/local/bin/test-edgectl.sh \
/usr/local/bin/vault-cert
COPY --from=build /go/bin/controller \
/go/bin/crmserver \
/go/bin/dme-server \
/go/bin/cluster-svc \
/go/bin/edgectl \
/go/bin/tok-srv-sim \
/go/bin/loc-api-sim \
/go/bin/mc \
/go/bin/shepherd \
/go/bin/mcctl \
/go/bin/resource-tracker \
/go/bin/autoprov \
/go/bin/notifyroot \
/usr/local/bin/
COPY --from=build /go/plugins /plugins
COPY --from=build /go/src/github.com/mobiledgex/edge-cloud/edgeproto/doc/*.json /usr/local/doc/internal/
COPY --from=build /go/src/github.com/mobiledgex/edge-cloud/edgeproto/external-doc/*.json /usr/local/doc/external/
COPY --from=build /go/src/github.com/mobiledgex/edge-cloud/d-match-engine/dme-proto/external-doc/*.json /usr/local/doc/client/
COPY --from=build /go/src/github.com/mobiledgex/edge-cloud-infra/doc/apidocs.swagger.json /usr/local/doc/mc/
RUN echo $BUILD_TAG >/version.txt
ENTRYPOINT [ "edge-cloud-entrypoint.sh" ]
CMD []