-
Notifications
You must be signed in to change notification settings - Fork 42
/
Dockerfile
71 lines (62 loc) · 2.59 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
# Copyright 2014 Google Inc.
#
# 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.
FROM ${docker.appengine.image}
ENV DEBIAN_FRONTEND noninteractive
# Create env vars to identify image
ENV OPENJDK_VERSION ${openjdk.version}
ENV GAE_IMAGE_NAME ${project.artifactId}
ENV GAE_IMAGE_LABEL ${docker.tag.long}
RUN echo 'deb http://archive.debian.org/debian stretch main' > /etc/apt/sources.list \
&& apt-get -q update \
&& apt-get -y -q --no-install-recommends install \
# install the jdk and its dependencies
ca-certificates-java \
# procps is used in the jvm shutdown hook
procps \
# other system utilities
netbase \
wget \
unzip \
fontconfig \
locales \
# cleanup package manager caches
&& apt-get clean \
&& rm /var/lib/apt/lists/*_*
ARG OPENJDK_VER='jdk8u345-b01'
ARG OPENJDK_VER_NAME='8u345b01'
ARG OPENJDK_TEMP_PATH='/tmp/openjdk'
ARG OPENJDK_OUT='/usr/lib/openjdk'
ENV PATH $OPENJDK_OUT/bin:$PATH
ENV JAVA_HOME $OPENJDK_OUT
RUN mkdir -p $OPENJDK_TEMP_PATH \
&& mkdir -p $OPENJDK_OUT \
&& wget -O $OPENJDK_TEMP_PATH/openjdk.tar.gz https://github.com/adoptium/temurin8-binaries/releases/download/$OPENJDK_VER/OpenJDK8U-jdk_x64_linux_hotspot_$OPENJDK_VER_NAME.tar.gz \
&& tar Cxfvz --file $OPENJDK_TEMP_PATH/openjdk.tar.gz --directory $OPENJDK_TEMP_PATH --no-same-owner \
&& rm $OPENJDK_TEMP_PATH/openjdk.tar.gz \
&& cp -r $OPENJDK_TEMP_PATH/$OPENJDK_VER/* $OPENJDK_OUT \
&& rm -rf $OPENJDK_TEMP_PATH \
&& ln -s $OPENJDK_OUT/bin/* /usr/local/bin/
# Add the Stackdriver Profiler libraries
ADD https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz /opt/cprof/
COPY docker-entrypoint.bash /
COPY setup-env.d /setup-env.d/
COPY shutdown/ /shutdown/
RUN tar Cxfvz /opt/cprof /opt/cprof/profiler_java_agent.tar.gz --no-same-owner \
&& rm /opt/cprof/profiler_java_agent.tar.gz \
&& chmod +x /docker-entrypoint.bash /shutdown/*.bash /setup-env.d/*.bash \
&& mkdir /var/log/app_engine \
&& chmod go+rwx /var/log/app_engine
ENV APP_DESTINATION ${docker.application.destination}
ENTRYPOINT ["/docker-entrypoint.bash"]
CMD ["java", "-jar", "${docker.application.destination}"]