forked from woonsanko/recipe-for-dockerizing-hippo-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (54 loc) · 2.96 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
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
###############################################################################
# Base Image
###############################################################################
FROM tomcat:8.5-jre8
# Tomcat Base Directory, inherited from the base image by default.
ENV CATALINA_BASE "/usr/local/tomcat"
# Customize catalina.properties to add additional common and shared loader jar paths.
RUN sed -i s:common.loader=\.\*:common.loader=\${catalina.base}/lib,\${catalina.base}/lib/\*\.jar,\${catalina.base}/common/lib/\*\.jar,\${catalina.home}/lib,\${catalina.home}/lib/\*\.jar:g ${CATALINA_BASE}/conf/catalina.properties
RUN sed -i s:shared.loader=\.\*:shared.loader=\${catalina.base}/shared/classes,\${catalina.base}/shared/lib/\*\.jar:g ${CATALINA_BASE}/conf/catalina.properties
###############################################################################
# Environment Variable Configurations
###############################################################################
# JVM Heap Size
ENV MIN_HEAP_SIZE "1024m"
ENV MAX_HEAP_SIZE "2048m"
# Repository Configuration File
ARG REPOSITORY_XML
COPY ${REPOSITORY_XML} ${CATALINA_BASE}/conf/repository.xml
ENV REPO_CONFIG "file:${CATALINA_BASE}/conf/repository.xml"
# Repository Directory
ENV REPO_PATH "${CATALINA_BASE}/repository"
# Bootstrapping enabled?
ENV REPO_BOOTSTRAP "true"
# Index Export Zip file download URIs (e.g, file path that could possibly be shared through a shared Docker Volume).
# Note: You can set space-separated string to specify multiple URIs including SFTP, HTTP, HTTPS, etc. See index-init.sh for detail.
ENV INDEX_EXPORT_ZIP "/data/index/index-export-latest.zip"
# Repository Cluster Node ID
ENV CLUSTER_ID "$(whoami)-$(hostname -f)"
###############################################################################
# Remove existing artifacts and install new ones by extracting the tar ball
###############################################################################
RUN rm -rf ${CATALINA_BASE}/common/lib/*.jar
RUN rm -rf ${CATALINA_BASE}/shared/lib/*.jar
RUN rm -rf ${CATALINA_BASE}/webapps/*
ARG SETENV_SH
COPY ${SETENV_SH} ${CATALINA_BASE}/bin/
ARG INDEX_INIT_SH
COPY ${INDEX_INIT_SH} ${CATALINA_BASE}/bin/
ARG TAR_BALL
ADD ${TAR_BALL} ${CATALINA_BASE}/