Differences

This shows you the differences between two versions of the page.

Link to this comparison view

server:docker:docker-images [14/05/2019 12:06]
Anthony Arents [Dockerfile]
server:docker:docker-images [04/06/2019 16:15] (current)
Anthony Arents [maven plugin config]
Line 1: Line 1:
 ====== Docker ====== ====== Docker ======
 +===== Preliminary research =====
 +==== Docker network ====
 +
 +allow containers to talk to eachother
 +
 +just run
 +
 +<code>docker network create dockernetwork</code>
 +
 +==== mysql ====
 +
 +we need to expose port 3306, we’ll also port 3306 so we can manage it via mysql-client
 +
 +endresult needs to start with
 +--network=dockernetwork
 +--name=mysql
 +-p 3306:3306
 +
 +==== Apache2 ====
 +
 +endresult needs to start with
 +-p 80:80
 +-p 443:443
 +--network=dockernetwork
 +--name=apache2
 +
 +==== java8+tomcat6+wkhtmltopdf ====
 +
 +this build needs to expose 8009 (AJP)
 +webapps which are deployed will probably need to change their jdbcURL, localhost -> mysql
 +endresult needs to start with -v $(pwd)/target/documents:/var/documents --network=dockernetwork --name=tomcatinstance1 -p 8009:8009
 +
 +===== Visualisation =====
 +{{:server:docker:untitled-1.png?nolink|}}
 +===== sources : =====
 +
 +Our current ubuntu configuration steps :\\ 
 +http://wiki.mentoringsystems.be/server/ubuntu/ubuntu-installation-new#install_configure_mysql
 +
 +multiple instances :\\ 
 +https://medium.com/@lasithaben/install-docker-and-multiple-tomcats-7bc8a6bf39e6
 +
 +volumes :\\ 
 +https://docs.docker.com/storage/volumes/
 +
 +full setup with composer :\\ 
 +https://beautifulbytes.wordpress.com/2016/01/04/set-up-apache-httpd-and-tomcat-with-docker-compose/
 +
 +mysql in docker:\\ 
 +https://dev.mysql.com/doc/mysql-installation-excerpt/5.5/en/docker-mysql-more-topics.html#docker-persisting-data-configuration
 +
 +network :\\ 
 +https://docs.docker.com/network/
 +
 +opening ports :\\ 
 +https://medium.freecodecamp.org/expose-vs-publish-docker-port-commands-explained-simply-434593dbc9a3
 +
 +
 +====== Docker images ======
 ===== Apache 2.4 ===== ===== Apache 2.4 =====
 ==== Dockerfile ==== ==== Dockerfile ====
Line 7: Line 66:
 COPY ./my-httpd-security.conf /usr/local/apache2/conf/extra/httpd-security.conf</code> COPY ./my-httpd-security.conf /usr/local/apache2/conf/extra/httpd-security.conf</code>
 ==== my-httpd.conf ==== ==== my-httpd.conf ====
-<code>#+<code - my-httpd.conf>#
 # This is the main Apache HTTP server configuration file.  It contains the # This is the main Apache HTTP server configuration file.  It contains the
 # configuration directives that give the server its instructions. # configuration directives that give the server its instructions.
Line 562: Line 621:
  
 ==== my-httpd-security.conf ==== ==== my-httpd-security.conf ====
-<code>#+<code - my-httpd-security.conf>#
 # Disable access to the entire file system except for the directories that # Disable access to the entire file system except for the directories that
 # are explicitly allowed later. # are explicitly allowed later.
Line 649: Line 708:
 ===== Mysql ===== ===== Mysql =====
 ==== Dockerfile ==== ==== Dockerfile ====
-<code>FROM mysql:5.7+<code - Dockerfile>FROM mysql:5.7
 COPY ./my-mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf</code> COPY ./my-mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf</code>
 ==== my-mysqld.cnf ==== ==== my-mysqld.cnf ====
-<code>#+<code - my-mysqld.cnf>#
 # The MySQL database server configuration file. # The MySQL database server configuration file.
 # #
Line 758: Line 817:
 </code> </code>
 ===== Suite ===== ===== Suite =====
-This works with a maven plugin developped by spotify+This works with a maven plugin developped by spotify, dockerfile & config files need to be placed in the ROOT of the project folder
 ==== maven plugin config ==== ==== maven plugin config ====
 placed as last in pom.xml (build/plugins/) placed as last in pom.xml (build/plugins/)
Line 775: Line 834:
                 </executions>                 </executions>
                 <configuration>                 <configuration>
 +                    <skip>${dockerskip}</skip>
                     <repository>jcp/suite</repository>                     <repository>jcp/suite</repository>
                     <tag>${analyse.buildconfig}</tag>                     <tag>${analyse.buildconfig}</tag>
Line 784: Line 844:
             </plugin></code>             </plugin></code>
 ==== Dockerfile ==== ==== Dockerfile ====
-<code>FROM openjdk:8-jre+<code - Dockerfile>FROM openjdk:8-jre
  
 RUN apt-get update && apt-get install -y --no-install-recommends apt-utils RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
Line 799: Line 859:
  
 #wkhtmltopdf #wkhtmltopdf
-RUN apt-get install -y \+RUN DEBIAN_FRONTEND=noninteractive; \ 
 +    apt-get install -y \
         curl \         curl \
         xfonts-base \         xfonts-base \
         xfonts-75dpi \         xfonts-75dpi \
 +        libjpeg62-turbo \
 +        libx11-6 \
 +        libxext6 \
 +        libxrender1 \
     && apt-get clean \     && apt-get clean \
     && curl "https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb" -L -o "wkhtmltopdf.deb" \     && curl "https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb" -L -o "wkhtmltopdf.deb" \
Line 823: Line 888:
  
 ENTRYPOINT "/opt/tomcat/run.sh"</code> ENTRYPOINT "/opt/tomcat/run.sh"</code>
 +
 +==== setenv.sh ====
 +<code - setenv.sh>CATALINA_PID="$CATALINA_BASE/logs/tomcat.pid"
 +DEBUG_OPTS="-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true"
 +HEAP_OPTS="-Xms512m -Xmx1024m"
 +BIT_MODE="-d64"         # Set -d32 bits or -d64 bits mode
 +JVM_MODE="-server"      # Set -client or -server mode
 +LOCALE_OPTS="-Duser.language=de -Duser.region=DE"
 +
 +JAVA_OPTS="$BIT_MODE $JVM_MODE $HEADLESS_MODE $HEAP_OPTS -Djavax.net.ssl.trustStore=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/security/cacerts $DEBUG_OPTS $LOCALE_OPTS"</code>
 +
 +==== tomcatrun.sh ====
 +<code - tomcatrun.sh>cd /opt/tomcat/webapps/
 +../bin/catalina.sh run</code>