-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
86 lines (73 loc) · 3.93 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
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
ARG BASE_IMAGE
ARG BASE_IMAGE_VERSION
ARG BASE_IMAGE_VERSION_NON_MIN
ARG BUILD_IMAGE
ARG BUILD_IMAGE_VERSION
FROM ${BUILD_IMAGE}:${BUILD_IMAGE_VERSION} as builder
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} as intermediate
# Pull in built binaries
COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-baker-* /home/tezos/bin/
COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-endorser-* /home/tezos/bin/
COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-accuser-* /home/tezos/bin/
COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-client /home/tezos/bin/
COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-admin-client /home/tezos/bin/
COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-node /home/tezos/bin/
COPY --chown=tezos:nogroup --from=builder /home/tezos/tezos/tezos-signer /home/tezos/bin/
# Add entrypoint scripts
COPY --chown=tezos:nogroup scripts/docker/entrypoint.* /home/tezos/bin/
# Add scripts
COPY --chown=tezos:nogroup scripts/alphanet_version scripts/tezos-docker-manager.sh src/bin_client/bash-completion.sh active_protocol_versions /home/tezos/scripts/
# Although alphanet.sh has been replaced by tezos-docker-manager.sh,
# the built-in auto-update mechanism expects an alphanet.sh script to exist.
# So we keep it for a while as a symbolic link.
CMD ln -s tezos-docker-manager.sh /home/tezos/scripts/alphanet.sh
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} as debug
ARG BUILD_IMAGE
ARG BUILD_IMAGE_VERSION
ARG COMMIT_SHORT_SHA
LABEL maintainer="[email protected]" \
org.label-schema.name="Tezos" \
org.label-schema.docker.schema-version="1.0" \
org.label-schema.description="Tezos node" \
org.label-schema.url="https://www.nomadic-labs.com" \
org.label-schema.vcs-url="https://gitlab.com/tezos/tezos" \
org.label-schema.vcs-ref="${COMMIT_SHORT_SHA}" \
org.label-schema.build-image="${BUILD_IMAGE}:${BUILD_IMAGE_VERSION}"
RUN sudo apk --no-cache add vim
ENV EDITOR=/usr/bin/vi
COPY --chown=tezos:nogroup --from=intermediate /home/tezos/bin/ /usr/local/bin/
COPY --chown=tezos:nogroup --from=intermediate /home/tezos/scripts/ /usr/local/share/tezos/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION_NON_MIN} as stripper
COPY --chown=tezos:nogroup --from=intermediate /home/tezos/bin/tezos-* /home/tezos/bin/
RUN strip /home/tezos/bin/tezos*
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} as bare
ARG BUILD_IMAGE
ARG BUILD_IMAGE_VERSION
ARG COMMIT_SHORT_SHA
LABEL maintainer="[email protected]" \
org.label-schema.name="Tezos" \
org.label-schema.docker.schema-version="1.0" \
org.label-schema.description="Tezos node" \
org.label-schema.url="https://www.nomadic-labs.com" \
org.label-schema.vcs-url="https://gitlab.com/tezos/tezos" \
org.label-schema.vcs-ref="${COMMIT_SHORT_SHA}" \
org.label-schema.build-image="${BUILD_IMAGE}:${BUILD_IMAGE_VERSION}"
COPY --chown=tezos:nogroup --from=stripper /home/tezos/bin/ /usr/local/bin/
COPY --chown=tezos:nogroup --from=intermediate /home/tezos/scripts/ /usr/local/share/tezos
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} as minimal
ARG BUILD_IMAGE
ARG BUILD_IMAGE_VERSION
ARG COMMIT_SHORT_SHA
LABEL maintainer="[email protected]" \
org.label-schema.name="Tezos" \
org.label-schema.docker.schema-version="1.0" \
org.label-schema.description="Tezos node" \
org.label-schema.url="https://www.nomadic-labs.com" \
org.label-schema.vcs-url="https://gitlab.com/tezos/tezos" \
org.label-schema.vcs-ref="${COMMIT_SHORT_SHA}" \
org.label-schema.build-image="${BUILD_IMAGE}:${BUILD_IMAGE_VERSION}"
COPY --chown=tezos:nogroup --from=stripper /home/tezos/bin/ /usr/local/bin/
COPY --chown=tezos:nogroup --from=intermediate /home/tezos/bin/entrypoint.* /usr/local/bin/
COPY --chown=tezos:nogroup --from=intermediate /home/tezos/scripts/ /usr/local/share/tezos
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]