forked from openpitrix/openpitrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.metadata
36 lines (25 loc) · 1.26 KB
/
Dockerfile.metadata
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
# Copyright 2017 The OpenPitrix Authors. All rights reserved.
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.
FROM openpitrix/openpitrix-builder as builder
WORKDIR /go/src/openpitrix.io/openpitrix/
COPY . .
RUN apk add --no-cache util-linux
RUN mkdir -p /metadata_bin
RUN go generate openpitrix.io/openpitrix/pkg/version && \
CGO_ENABLED=0 GOOS=linux GOBIN=/metadata_bin go install -ldflags '-w -s' -tags netgo openpitrix.io/openpitrix/metadata/cmd/...
RUN find /metadata_bin -type f -exec upx {} \;
FROM alpine:3.7
RUN apk add --update ca-certificates && update-ca-certificates
COPY --from=builder /usr/bin/nsenter /usr/bin/
COPY --from=builder /metadata_bin/drone /usr/local/bin/
COPY --from=builder /metadata_bin/frontgate /usr/local/bin/
RUN apk add --no-cache supervisor
COPY metadata/supervisord/supervisord.conf /etc/
COPY metadata/supervisord/start-supervisord.sh /usr/local/bin/
COPY metadata/supervisord/frontgate/start-frontgate.sh /usr/local/bin/
COPY metadata/supervisord/drone/start-drone.sh /usr/local/bin/
RUN mkdir -p /etc/supervisor.d
COPY metadata/supervisord/frontgate/frontgate.ini /etc/supervisor.d
COPY metadata/supervisord/drone/drone.ini /etc/supervisor.d
ENTRYPOINT ["start-supervisord.sh"]