Skip to content

Instantly share code, notes, and snippets.

@jonmosco
Created February 14, 2017 22:52
Show Gist options
  • Save jonmosco/5029db16aeb51f7754a134b13366b872 to your computer and use it in GitHub Desktop.
Save jonmosco/5029db16aeb51f7754a134b13366b872 to your computer and use it in GitHub Desktop.
Complete!
---> 474a6ca970d3
Removing intermediate container c287c8ec9d7d
Step 6 : ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre
---> Running in b7c59f3673bc
---> 62068472e85c
Removing intermediate container b7c59f3673bc
Step 7 : RUN mkdir -p /opt/tomcat/instances
---> Running in e5193f85b44f
---> 2c2b5940ed16
Removing intermediate container e5193f85b44f
Step 8 : COPY pivotal-tc-server-standard-3.1.0.RELEASE.tar.gz /opt/tomcat/pivotal-tc-server-standard-3.1.0.RELEASE.tar.gz
---> 04d485ebf1a4
Removing intermediate container c0725d5287e5
Step 9 : RUN tar xzf /opt/tomcat/pivotal-tc-server-standard-3.1.0.RELEASE.tar.gz -C /opt/tomcat/
---> Running in 4f4538ecbb59
---> 0bee32308ee5
Removing intermediate container 4f4538ecbb59
Step 10 : ARG INSTANCE_NAME=app01
---> Running in 8dae28ff236b
---> 30a63e6f9169
Removing intermediate container 8dae28ff236b
Step 11 : ENV INSTANCE_NAME ${INSTANCE_NAME}
---> Running in 690119266a74
---> f505700bcc5d
Removing intermediate container 690119266a74
Step 12 : RUN /opt/tomcat/pivotal-tc-server-standard-3.1.0.RELEASE/tcruntime-instance.sh create $INSTANCE_NAME --template bio --template ajp --template clu
ster-node --property ajp.http.port=8009 --property ajp.https.port=8444 --property base.jmx.port=8999 --property base.shutdown.port=8005 --propertybio.http
.port=8080 --property bio.https.port=8443 --property base.runtime.user=tomcat --property cluster-node.node.name=$INSTANCE_NAME -i /opt/tomcat/instances
---> Running in 25618e191acf
Creating instance 'test_new_instance' ...
Using separate layout
Creating bin/setenv.sh
Applying template 'base'
Copying template's contents
Applying fragment 'context-fragment.xml' to 'conf/context.xml'
Applying fragment 'server-fragment.xml' to 'conf/server.xml'
Applying fragment 'web-fragment.xml' to 'conf/web.xml'
Applying fragment 'tomcat-users-fragment.xml' to 'conf/tomcat-users.xml'
Applying fragment 'logging-fragment.properties' to 'conf/logging.properties'
Applying fragment 'catalina-fragment.properties' to 'conf/catalina.properties'
Applying template 'base-tomcat-7'
Copying template's contents
Applying fragment 'server-fragment.xml' to 'conf/server.xml'
Applying fragment 'web-fragment.xml' to 'conf/web.xml'
Applying fragment 'logging-fragment.properties' to 'conf/logging.properties'
Applying fragment 'catalina-fragment.properties' to 'conf/catalina.properties'
Applying template 'bio'
Copying template's contents
Applying fragment 'server-fragment.xml' to 'conf/server.xml'
Applying template 'ajp'
Copying template's contents
Applying fragment 'server-fragment.xml' to 'conf/server.xml'
Applying template 'cluster-node-tomcat-7'
Copying template's contents
Applying fragment 'server-fragment.xml' to 'conf/server.xml'
Configuring instance 'test_new_instance' to use Tomcat version 7.0.59.B.RELEASE
Setting permissions
Instance created
Connector summary
Port: 8009 Type: Apache JServ Secure: false
Port: 8080 Type: Blocking IO Secure: false
---> f77bd88ead63
Removing intermediate container 25618e191acf
Step 13 : VOLUME /opt/tomcat/instances/$INSTANCE_NAME/webapps
---> Running in 3248da105cd1
---> 8b010944ff4e
Removing intermediate container 3248da105cd1
Step 14 : EXPOSE 8080
---> Running in 53a8f765ba33
---> 392cc6f67edf
Removing intermediate container 53a8f765ba33
Step 15 : CMD rm -f /opt/tomcat/instances/$INSTANCE_NAME/logs/tcserver.pid
---> Running in 1b8e8d9e7366
---> 16fd806da7d5
Removing intermediate container 1b8e8d9e7366
Step 16 : CMD /opt/tomcat/instances/$INSTANCE_NAME/bin/tcruntime-ctl.sh run
---> Running in 5f213a8c8123
---> 9fefe0e05cb7
Removing intermediate container 5f213a8c8123
Successfully built 9fefe0e05cb7
=============================================
FROM centos:7
RUN useradd tomcat
RUN yum -q makecache
# Java
RUN yum install -y java-1.8.0-openjdk
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre
# TC Server
RUN mkdir -p /opt/tomcat/instances
COPY pivotal-tc-server-standard-3.1.0.RELEASE.tar.gz /opt/tomcat/pivotal-tc-server-standard-3.1.0.RELEASE.tar.gz
RUN tar xzf /opt/tomcat/pivotal-tc-server-standard-3.1.0.RELEASE.tar.gz -C /opt/tomcat/
# Instance name
ARG INSTANCE_NAME=app01
ENV INSTANCE_NAME ${INSTANCE_NAME}
# Create our instance
# TODO: be able to pass in instance name parameter
RUN /opt/tomcat/pivotal-tc-server-standard-3.1.0.RELEASE/tcruntime-instance.sh \
create $INSTANCE_NAME \
--template bio \
--template ajp \
--template cluster-node \
--property ajp.http.port=8009 \
--property ajp.https.port=8444 \
--property base.jmx.port=8999 \
--property base.shutdown.port=8005 \
--property bio.http.port=8080 \
--property bio.https.port=8443 \
--property base.runtime.user=tomcat \
--property cluster-node.node.name=$INSTANCE_NAME \
-i /opt/tomcat/instances
VOLUME [ "/opt/tomcat/instances/$INSTANCE_NAME/webapps" ]
# Make port 8080 available
EXPOSE 8080
# Remove pid file
CMD rm -f /opt/tomcat/instances/$INSTANCE_NAME/logs/tcserver.pid
# run causes it to run in the foreground
CMD [ "/opt/tomcat/instances/$INSTANCE_NAME/bin/tcruntime-ctl.sh", "run"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment