-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Peter,
On 1/10/20 8:06 AM, logo wrote: > Alex, > > Am 2020-01-10 12:47, schrieb Alex K: >> Just to follow-up on this in case it will be useful to anyone, I >> managed to use also the official tomcat image. I had to amend my >> .war files and use the openjdk:8-jdk version instead of >> openjdk:11-jdk. >> >> I have used the following Docker files to prepare my custom >> tomcat image (so as to have tomcat home at /opt/tomcat) and then >> deployed the final app as following: >> >> Got openjdk:8-jdk Docker file from: >> https://github.com/docker-library/tomcat/blob/807a2b4f219d70f5ba6f477 3d4ee4ee155850b0d/8.5/jdk8/openjdk/Dockerfile >> >> >> Amended the tomcat home to /opt/tomcat. >> >> Then deployed the app using the following Docker file: >> >> FROM tomcat:custom USER root ENV CATALINA_HOME /opt/tomcat ENV >> PATH $CATALINA_HOME/bin:$PATH RUN mkdir -p "$CATALINA_HOME" >> WORKDIR $CATALINA_HOME ADD iforms_files/app.war >> $CATALINA_HOME/webapps/ ADD iforms_files/orbeon.war >> $CATALINA_HOME/webapps/ ADD iforms_files/server.xml >> $CATALINA_HOME/conf/ ADD >> iforms_files/mariadb-java-client-2.4.1.jar $CATALINA_HOME/lib ADD >> iforms_files/setenv.sh $CATALINA_HOME/bin/ EXPOSE 8443 CMD >> ["catalina.sh", "run"] >> >> I also tried the alpine versions: >> https://hub.docker.com/layers/openjdk/library/openjdk/8-jre-alpine3.9 /images/sha256-ea81da311d33e052eeea34336018434bdc50596100f9c623193867faa 291b284 >> >> >> >> by using the same Dockerfile (by pointing to the custom built image FROM >> tomcat:alpine) I was able to deploy same app successfully >> reaching image size 281MB instead of 660MB with the default >> tomcat image. >> >> > Almost perfect. > > Now have a look at > https://tomcat.apache.org/tomcat-9.0-doc/introduction.html#CATALINA_HO ME_and_CATALINA_BASE. > > > > This way you don't have to change the installation directory. > > set CATALINA_BASE to /opt/tomcat and deploy all your conf and > webapp to the directories underneath /opt/tomcat. > > like this: > > FROM tomcat:8-jdk8-openjdk-slim #(slim saves you space) > > ENV CATALINA_BASE /opt/tomcat WORKDIR $CATALINA_BASE RUN mkdir -p > temp logs work webapps conf ADD iforms_files/app.war > $CATALINA_BASE/webapps/ ADD iforms_files/orbeon.war > $CATALINA_BASE/webapps/ ADD iforms_files/server.xml > $CATALINA_BASE/conf/ # you do need those: ADD > iforms_files/tomcat-users.xml $CATALINA_BASE/conf/ ADD > iforms_files/web.xml $CATALINA_BASE/conf/ > > ADD iforms_files/mariadb-java-client-2.4.1.jar $CATALINA_BASE/lib > ADD iforms_files/setenv.sh $CATALINA_BASE/bin/ > > EXPOSE 8443 CMD ["catalina.sh", "run"] > > optionally I'd recommend to change the user to tomcat (root is > baaah) +1 many times Remember, root in Docker is also root outside docker. - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4bTBsACgkQHPApP6U8 pFgtpxAAnie14dTJg+v/DEmFnPRKRietvBhTRqxduMVAUXr11L0G/m8Ibh5irwR8 ZhTkuiieWdtCz/+dQLMzQIHk/QIbQTK1xTXTrjKgZxCGG87/lmEft2hR3CU2IC5O CZg1oyeGMpwJqYNOMszTbMeJcyU02qHpmf6iD8W3iPZVlDzkR3vjbA98V/+Q4KhZ 0Mv7uhE22/2Mq17CLFNo15zneP3oAg2UbGf8AzO3RM0ZGLKtGmBSUVz5nVvGxnp7 BS1VMXws66oy9LsLGvf5uf68VbYmh9VUIvODnb0HjKKxZBoWTfOwt/DKLj9QpUWr 2ucSrlt5iyjuT6zQPqDMH0V5GVtM2eXrlOSx6L2BYslgH6bG7eFRO7hU69RIlkLh aQMjUSEBAd6QKS+6QdbD+9gU9ZAew7OMhW3oJv5Ym89YIFzSonwKdav9780QCEry Pw5g4+gJBK/V+7tdjz0HVAO3NRpDOcxKAtpjFoJmtOWYf136jbwboyGMT1IOnksp oZMAsnrv7sU1Ig28ETmGyBudzZWpWImY8CsXZVVozU9XjIh0ivsLhS0A9vmQ5SUs Z+pwoQ/+tX0NQPh4gJCdX1hwt4CeCdNQ88fEvBgfho0p4LvvcdtBJcUlRGhy7xaq IgB0C4kxE0PAjq864oKt+3deqcHVZYzByBUUNnHAtiAUhx28N/E= =m7RV -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org