Last active
August 29, 2015 14:13
-
-
Save rmpestano/42134170bdd0d8b5fdf2 to your computer and use it in GitHub Desktop.
autoStartContainers conflict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I am facing an issue with autoStartContainers. The problem is that when image is built the container is also created, buildImageCmd.exe() - http://i.imgur.com/HFUy3Qm.png[img1]. So when the create container command is fired with createContainerCmd.exec() - http://i.imgur.com/caGBfQy.png[img2] I receive "Conflict, the name wildfly is already assigned to.... ". Am I doing something wrong? here is my arquillian.xml: | |
| [source,xml] | |
| .arquillian.xml | |
| ---- | |
| <arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns="http://jboss.org/schema/arquillian" | |
| xsi:schemaLocation=" | |
| http://jboss.org/schema/arquillian | |
| http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | |
| <!-- Force the use of the Servlet 3.0 protocol with all containers, as it | |
| is the most mature --> | |
| <defaultProtocol type="Servlet 3.0"/> | |
| <extension qualifier="docker"> | |
| <property name="serverVersion">1.12</property> | |
| <property name="serverUri">http://localhost:2375</property> | |
| <property name="autoStartContainers">wildfly</property> | |
| <property name="dockerContainers"> | |
| car_service: | |
| image: javaee_sample | |
| exposedPorts: [8080/tcp, 9990/tcp] | |
| await: | |
| strategy: polling | |
| portBindings: [8180->8080/tcp, 9991->9990/tcp] | |
| wildfly: | |
| buildImage: | |
| dockerfileLocation: /home/rmpestano/projects/javaee-docker-sample/java_ee/ | |
| noCache: true | |
| remove: true | |
| exposedPorts: [8080/tcp, 9990/tcp] | |
| await: | |
| strategy: polling | |
| portBindings: [8280/tcp, 9992->9990/tcp] | |
| </property> | |
| </extension> | |
| <container qualifier="wildfly-docker"> | |
| <configuration> | |
| <property name="managementAddress">127.0.0.1</property> | |
| <property name="managementPort">9992</property> | |
| </configuration> | |
| </container> | |
| <container qualifier="wildfly-remote"> | |
| <configuration> | |
| <property name="managementAddress">127.0.0.1</property> | |
| <property name="managementPort">9992</property> | |
| </configuration> | |
| </container> | |
| <container qualifier="jboss-remote"> | |
| <configuration> | |
| <property name="managementAddress">127.0.0.1</property> | |
| <property name="managementPort">9999</property> | |
| </configuration> | |
| </container> | |
| </arquillian> | |
| ---- | |
| Here is the Dockerfile: | |
| [source,xml] | |
| ---- | |
| FROM ubuntu | |
| MAINTAINER Rafael Pestano <rmpestano@gmail.com> | |
| # setup WildFly | |
| COPY wildfly-8.2.0.Final /opt/wildfly | |
| # setup Java | |
| RUN mkdir /opt/java | |
| COPY jdk-8u25-linux-x64.tar.gz /opt/java/ | |
| # change dir to Java installation dir | |
| WORKDIR /opt/java/ | |
| RUN tar -zxf jdk-8u25-linux-x64.tar.gz | |
| # setup nvironment variables | |
| RUN update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.8.0_25/bin/javac 100 | |
| RUN update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_25/bin/java 100 | |
| RUN update-alternatives --display java | |
| RUN java -version | |
| # Expose the ports we're interested in | |
| EXPOSE 8080 9990 | |
| # Set the default command to run on boot | |
| # This will boot WildFly in the standalone mode and bind to all interface | |
| CMD ["/opt/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"] | |
| ---- | |
| In Arquillian Cube ftest project when I try autoStartContainers with tomcat_dockerfile cube i receive nullpointer at DockerclientExecutor#buildImage method > InputStream response = buildImageCmd.exec(); because buildImageCmd is null. Autostart works with tomcat_default. | |
| EDIT | |
| sorry tomcat_dockerfile also works(forgot to copy the image to my project) so the problem is probably with my wildfly image. |
Author
Author
got it working with your hints. renamed wildfly to wildfly-docker an dremoved autoStatContainers in arquillian.xml. Thank you guys!
you are welcome, the problem is that if container is not removed then you cannot start them again, if for example you don't finish the test for some reason, the logic for removing the container is not executed and you should do it manually.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry tomcat_dockerfile also works(forgot to copy the image to my project) so the problem is probably with my wildfly image.