forked from openzipkin/zipkin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.release
111 lines (84 loc) · 4.31 KB
/
Dockerfile.release
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
99
100
101
102
103
104
105
106
107
108
109
110
111
#
# Copyright 2015-2020 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
# Download artifact from bintray, where the artifact should have been published by now.
FROM openzipkin/zipkin-builder as built
ARG source_branch
# source_branch is something like
#
# master - Building the master branch. This cut command will return 'master', and Dockerfiles will ignore it
# 1.0.1 - Building a release image along with a new Zipkin server version. This cut command will return
# '1.0.1' and Dockerfiles will use it to fetch the correct version of Zipkin.
# docker-1.0.1 - Building a release image, but not a new Zipkin server. This cut command will return
# '1.0.1' and Dockerfiles will use it to fetch the correct version of Zipkin.
RUN export version=$(echo "${source_branch}" | cut -d '-' -f 2) && \
# Download jars using Maven. It will try to resolve the artifact from Maven Central, which might
# not work right away if the sync is taking time, followed by bintray, which should always work
# since it's where we publish to.
mvn org.apache.maven.plugins:maven-dependency-plugin:get \
-DremoteRepositories=bintray::::https://dl.bintray.com/openzipkin/maven -Dtransitive=false \
-Dartifact=io.zipkin:zipkin-server:${version}:jar:exec && \
mvn org.apache.maven.plugins:maven-dependency-plugin:get \
-DremoteRepositories=bintray::::https://dl.bintray.com/openzipkin/maven -Dtransitive=false \
-Dartifact=io.zipkin:zipkin-server:${version}:jar:slim && \
# Extract the built out of the Maven repository
mkdir -p /zipkin && cp ~/.m2/repository/io/zipkin/zipkin-server/${version}/zipkin-server-${version}-exec.jar /zipkin && cd /zipkin && jar xf *.jar && rm *.jar && \
mkdir -p /zipkin-slim && cp ~/.m2/repository/io/zipkin/zipkin-server/${version}/zipkin-server-${version}-slim.jar /zipkin-slim && cd /zipkin-slim && jar xf *.jar && rm *.jar && \
# Extract zipkin-lens
mkdir -p /zipkin-lens && cp /zipkin/BOOT-INF/lib/zipkin-lens-${version}.jar /zipkin-lens && cd /zipkin-lens && jar xf *.jar && rm *.jar
#####
# zipkin-ui - An image containing the Zipkin web frontend only, served by NGINX
#####
FROM nginx:1.16-alpine as zipkin-ui
LABEL MAINTAINER Zipkin "https://zipkin.io/"
ENV ZIPKIN_BASE_URL=http://zipkin:9411
COPY --from=built /zipkin-lens/zipkin-lens /var/www/html/zipkin
RUN mkdir -p /var/tmp/nginx && chown -R nginx:nginx /var/tmp/nginx
#
# Setup services
COPY docker/lens/nginx.conf /etc/nginx/conf.d/zipkin.conf.template
COPY docker/lens/run.sh /usr/local/bin/nginx.sh
EXPOSE 80
CMD ["/usr/local/bin/nginx.sh"]
#####
# zipkin-slim - An image containing the slim distribution of Zipkin server.
#####
FROM openzipkin/jre-full:11.0.6-11.37 as zipkin-slim
LABEL MAINTAINER Zipkin "https://zipkin.io/"
# Use to set heap, trust store or other system properties.
ENV JAVA_OPTS -Djava.security.egd=file:/dev/./urandom
RUN adduser -g '' -h /zipkin -D zipkin && ln -s /busybox/* /bin
COPY --from=built --chown=zipkin /zipkin-slim/ /zipkin/
# Add environment settings for supported storage types
COPY --chown=zipkin docker/zipkin/ /zipkin/
WORKDIR /zipkin
USER zipkin
EXPOSE 9411
ENTRYPOINT ["/busybox/sh", "run.sh"]
#####
# zipkin-server - An image containing the full distribution of Zipkin server.
#####
FROM openzipkin/jre-full:11.0.6-11.37 as zipkin-server
LABEL MAINTAINER Zipkin "https://zipkin.io/"
# Use to set heap, trust store or other system properties.
ENV JAVA_OPTS -Djava.security.egd=file:/dev/./urandom
# 3rd party modules like zipkin-aws will apply profile settings with this
ENV MODULE_OPTS=
RUN adduser -g '' -h /zipkin -D zipkin && ln -s /busybox/* /bin
COPY --from=built --chown=zipkin /zipkin/ /zipkin/
# Add environment settings for supported storage types
COPY --chown=zipkin docker/zipkin/ /zipkin/
WORKDIR /zipkin
USER zipkin
EXPOSE 9410 9411
ENTRYPOINT ["/busybox/sh", "run.sh"]