Hi, You must create your own Dockerfile that starts with the TomEE image and then adds/updates files. Thereby you are creating your own layer with changes to the default Docker.
As an example, here are our layers of Dockerfiles starting with Ubuntu and then layering on top from there. You will see that we use curl and pull in files over HTTP during the docker build process. The HTTP server is basically serving out of a checkout of our build repository so it is creating docker images out of our latest artifacts. We have a build script that runs a full build and then creates all the docker images and pushes them to our own docker repository. ###################################################################################################################### # Ubuntu ###################################################################################################################### FROM ubuntu:latest # Needed packages RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" > /etc/apt/sources.list.d/webupd8team-java-xenial.list && \ echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \ apt-get update && \ apt-get install -y --allow-unauthenticated curl unzip subversion zip vim oracle-java8-installer && \ apt install -y oracle-java8-set-default ###################################################################################################################### # OracleJDK 8 ###################################################################################################################### RUN cd /tmp && \ curl -L -O -H "Cookie: oraclelicense=accept-securebackup-cookie" -k " http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip" && \ unzip jce_policy-8.zip && \ mv UnlimitedJCEPolicyJDK8/*.jar /usr/lib/jvm/java-8-oracle/jre/lib/security/ && \ rm -rf jce_policy-8.zip UnlimitedJCEPolicyJDK8 ENV JAVA_HOME=/usr/lib/jvm/java-8-oracle The above is built and pushed to our docker repo as jdk:latest Then: ###################################################################################################################### # Start with JDK ###################################################################################################################### FROM docker.smilecoms.com/jdk:latest ###################################################################################################################### # TomEE ###################################################################################################################### ENV PATH /opt/tomee/bin:$PATH RUN mkdir -p /opt/tomee WORKDIR /opt/tomee RUN set -x && PLUME_VER=7.0.3 && \ curl -fSL http://mirror.ox.ac.uk/sites/rsync.apache.org/tomee/tomee-$PLUME_VER/apache-tomee-$PLUME_VER-plume.tar.gz -o tomee.tar.gz && \ tar -zxf tomee.tar.gz && \ mv apache-tomee-plume-$PLUME_VER/* /opt/tomee && \ rm -Rf apache-tomee-plume-$PLUME_VER && \ rm bin/*.bat && \ rm tomee.tar.gz* && \ rm -rf /opt/tomee/webapps/* && \ apt-get update && \ apt-get install -y libapr1-dev libssl-dev build-essential && \ cd /opt/tomee/bin/ && \ tar -xvf tomcat-native.tar.gz && \ rm tomcat-native.tar.gz && \ cd tomcat-native-*/native/ && \ ./configure && make && make install The above is built and pushed to our docker repo as tomee:latest Then: ###################################################################################################################### # Start with TomEE ###################################################################################################################### FROM docker.smilecoms.com/tomee:latest ###################################################################################################################### # Smile Portals ###################################################################################################################### RUN CURLOPT="-fSLO http://127.0.0.1" && \ cd /opt/tomee/webapps/ && \ curl $CURLOPT/javaroot/SCP.war && \ cd /opt/tomee/lib/ && \ curl $CURLOPT/javaroot/HOBIT/target/mysql-connector-java.jar && \ cd /opt/tomee/conf/ && \ curl $CURLOPT/install/scripts/docker/portals/tomee.xml && \ curl $CURLOPT/install/scripts/docker/portals/logging.properties && \ curl $CURLOPT/install/scripts/docker/portals/server.xml && \ curl $CURLOPT/install/scripts/docker/portals/jaas.config && \ curl $CURLOPT/install/scripts/docker/portals/context.xml && \ cd /opt/tomee/bin/ && \ curl $CURLOPT/install/scripts/docker/portals/setenv.sh && \ cd / && \ curl $CURLOPT/install/scripts/docker/portals/run.sh && chmod +x /run.sh ###################################################################################################################### # CMD ###################################################################################################################### CMD ["/run.sh"] Our script run.sh starts tomee and then sleeps in a loop while tomee is still running. Hope this is a bit more clear. Its not a quick fix but is pretty bulletproof. Alternatively, if you want a quick fix then start your container and do docker exec -it <Name> bash and vi the files inside the running container. Then you can stop and start it without losing the changes. On 4 September 2017 at 17:15, mauro2java2011 <[email protected]> wrote: > Tanks for response. But my questions is : > > From the tomee image https://docs.docker.com/samples/library/tomee/ > > Inside the docker file i see that the tomee binaries are downloaded. > So into the tomee/conf dir is already present a tomee.xml when from the > image the tomee is downloaded. > So i ask: how i can ads the configuration of darasource into the tomee.xml? > I can pit a new tomee.xml using option -v of docker volume . But in this > case i have to erase the already preaent tomee.xml downloaded into the > image ? > > I hope i explained my problem. > Mauro > > > > > -- > Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users- > f979441.html > -- *Paul Carter-Brown* *Group Chief Information Officer* *Smile Communications Pty (Ltd) * Smile +234 (0) 702 000 1234 Mobile +27 (0) 83 4427 179 Skype PaulC-B [email protected] www.smilecoms.com -- This email is subject to the disclaimer of Smile Communications at http://www.smilecoms.com/home/email-disclaimer/ <http://www.smilecoms.com/disclaimer>
