-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathDockerfile
More file actions
81 lines (71 loc) · 3.16 KB
/
Dockerfile
File metadata and controls
81 lines (71 loc) · 3.16 KB
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
# (C) Copyright IBM Corporation 2014,2016.
#
# 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.
ARG PARENT_IMAGE=ibmjava:8-jre
FROM $PARENT_IMAGE
LABEL org.opencontainers.image.authors="Leo Christy Jesuraj, Arthur De Magalhaes, Chris Potter" \
org.opencontainers.image.vendor="IBM" \
org.opencontainers.image.url="http://wasdev.net" \
org.opencontainers.image.documentation="https://www.ibm.com/support/knowledgecenter/SSAW57_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/cwlp_about.html" \
org.opencontainers.image.version="2020.10.0.0" \
org.opencontainers.image.revision="cl201020200915-1100"
RUN apt-get update \
&& apt-get install -y --no-install-recommends unzip \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -u 1001 -r -g 0 -s /usr/sbin/nologin default
# Install WebSphere Liberty
ENV LIBERTY_VERSION 2020.10.0_0
RUN LIBERTY_URL=$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml | grep $LIBERTY_VERSION -A 3 | sed -n 's/\s*webProfile7:\s//p' | tr -d '\r') \
&& echo $LIBERTY_URL \
&& wget -q $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp-beta.zip \
&& unzip -q /tmp/wlp-beta.zip -d /opt/ibm \
&& rm /tmp/wlp-beta.zip \
&& chown -R 1001:0 /opt/ibm/wlp \
&& chmod -R g+rw /opt/ibm/wlp
ENV PATH=$PATH:/opt/ibm/wlp/bin
# Set Path Shortcuts
ENV LOG_DIR=/logs \
WLP_OUTPUT_DIR=/opt/ibm/wlp/output
# Configure WebSphere Liberty
RUN /opt/ibm/wlp/bin/server create \
&& rm -rf $WLP_OUTPUT_DIR/.classCache /output/workarea
COPY server.xml /opt/ibm/wlp/usr/servers/defaultServer/
# Create symlinks && set permissions for non-root user
RUN mkdir /logs \
&& mkdir /etc/wlp \
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
&& mkdir -p /home/default \
&& mkdir /output \
&& chmod -t /output \
&& rm -rf /output \
&& ln -s $WLP_OUTPUT_DIR/defaultServer /output \
&& ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \
&& ln -s /opt/ibm /liberty \
&& ln -s /opt/ibm/fixes /fixes \
&& ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \
&& mkdir -p /config/configDropins/defaults \
&& chown -R 1001:0 /config \
&& chmod -R g+rw /config \
&& chown -R 1001:0 /opt/ibm/wlp/usr \
&& chmod -R g+rw /opt/ibm/wlp/usr \
&& chown -R 1001:0 /opt/ibm/wlp/output \
&& chmod -R g+rw /opt/ibm/wlp/output \
&& chown -R 1001:0 /logs \
&& chmod -R g+rw /logs \
&& chown -R 1001:0 /etc/wlp \
&& chmod -R g+rw /etc/wlp \
&& chown -R 1001:0 /home/default \
&& chmod -R g+rw /home/default
USER 1001
EXPOSE 9080 9443
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]