<p>My problem was that the docker-machine didn't have enough memory to run both services at the same time.</p>

<p>Using those commands fixed it:</p>

<pre><code>docker-machine stop
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm default --cpus 2
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm default --memory 4096
docker-machine start
</code></pre>

<p>(The path to the VBoxManage.exe maybe be different for other users and it can be change to just "VBoxManage" if adding it to the environment paths)</p>

CC BY-SA 4.0
2019-03-25T15:02:44.513Z
2019-03-25T15:02:44.513Z
Tomerhek
<p>Most probably the problem with artifactory container is not really related to the ports, check if the docker ps always shows the same container id, if not its probably dying and coming back up, when you start the containers, do you use anything in -v? Have you checked the docker logs of the artifactory container when jenkins is down? Do a docker logs xxxx using the ID of the artifactory container that dies to see what happened. </p>

CC BY-SA 4.0
2019-03-10T06:58:36.530Z
2019-03-10T06:58:36.530Z
manuel220
<p>I have 2 images on my docker toolbox, for jenkins and for artifactory.
I can use the command "run" for each to create a running container, jenkins on port 8080 and artifactory on oprt 8081, using the -p flag.
When I use the command "docker ps" I can see both containers.</p>

<p>My problem: I can only open one application at a time, for example:
Open jenkins on URL 192.168.99.100:8080 (docker toolbox use this IP by default), then, open artifactory on URL 192.168.99.100:8081, the page "jFrog Artifactory is getting ready to work..." will be displayed and then the connection to the artifactory will be lost.
But if I stop the jenkins container I could run the artifactory application properly.</p>

<p>I read that docker compose can help to run multiple containers but I didn't understand if it can help my case too.</p>

<p>Any help?</p>

<p>Notes:</p>

<ul>
<li>My "docker ps" output (plus another command for better display)</li>
<li>I found out about nginx that can be used as reverse proxy but I managed to set only the Jenkins to work, the artifactory does not work. Seems like I am not configuring the .conf file properly. Is it possible to run artifactory via nginx without configuring SSL? Most of the examples I found had SSL in the .conf file.</li>
</ul>

<p><a href="https://i.sstatic.net/iaJvy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iaJvy.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2019-02-13T18:21:50.013Z
Could you edit your question with the output of your `docker ps` command?
Sylvain Leroux
CC BY-SA 4.0
2019-02-14T17:39:21.437Z
Why not put a third container with a reverse proxy in front of them when everything has to run on the same host / port combination ?
Marged
CC BY-SA 4.0
2019-02-27T09:13:34.273Z
What does the log of the Artifactory container say before dying? Run it without `-d` to see directly on the shell.
Raphael
<docker><jenkins><artifactory>
How to run multiple containers with port expose
Tomerhek
# How to run multiple containers with port expose

(Asked by: username_0 on 2019-02-13)

I have 2 images on my docker toolbox, for jenkins and for artifactory.
I can use the command "run" for each to create a running container, jenkins on port 8080 and artifactory on oprt 8081, using the -p flag.
When I use the command "docker ps" I can see both containers.

My problem: I can only open one application at a time, for example:
Open jenkins on URL 192.168.99.100:8080 (docker toolbox use this IP by default), then, open artifactory on URL 192.168.99.100:8081, the page "jFrog Artifactory is getting ready to work..." will be displayed and then the connection to the artifactory will be lost.
But if I stop the jenkins container I could run the artifactory application properly.

I read that docker compose can help to run multiple containers but I didn't understand if it can help my case too.

Any help?

Notes:

* My "docker ps" output (plus another command for better display)
* I found out about nginx that can be used as reverse proxy but I managed to set only the Jenkins to work, the artifactory does not work. Seems like I am not configuring the .conf file properly. Is it possible to run artifactory via nginx without configuring SSL? Most of the examples I found had SSL in the .conf file.

[![enter image description here](https://i.sstatic.net/iaJvy.png)](https://i.sstatic.net/iaJvy.png)

**Tags:** docker, jenkins, artifactory

> **Comments:**
> **username_1**: Could you edit your question with the output of your `docker ps` command?  
> **username_2**: Why not put a third container with a reverse proxy in front of them when everything has to run on the same host / port combination ?  
> **username_3**: What does the log of the Artifactory container say before dying? Run it without `-d` to see directly on the shell.  

---

## 2 answers

### Answer by username_0 on 2019-03-25. Score: 1

My problem was that the docker-machine didn't have enough memory to run both services at the same time.
Using those commands fixed it:
docker-machine stop
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm default --cpus 2
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm default --memory 4096
docker-machine start

(The path to the VBoxManage.exe maybe be different for other users and it can be change to just "VBoxManage" if adding it to the environment paths)


---

### Answer by username_4 on 2019-03-10. Score: 0

Most probably the problem with artifactory container is not really related to the ports, check if the docker ps always shows the same container id, if not its probably dying and coming back up, when you start the containers, do you use anything in -v? Have you checked the docker logs of the artifactory container when jenkins is down? Do a docker logs xxxx using the ID of the artifactory container that dies to see what happened.


---

