Without Docker
With Docker
Because for instance, 8080 of APP_B is only visible inside APP_B container. No body can access to this applications.
In order to access to your docker applications, You must explicitly establish a relationship between:
Linux host ports <->
inside containers ports.
To do that you could use -p parameter
- docker run -d -p 8080:8080 APP_A ...
- docker run -d -p 8081:8080 APP_B ...
- docker run -d -p 8082:8080 APP_C ...
After this you could access to your docker applications using its new ports :
Also a common error when docker-compose & docker network are used is use localhost instead ip when a docker app needs to connect to another docker app. As you can see you need to use ip or domain + external port instead localhost:8080
what is the difference between publishing 8080:80 and 8080:8080 in a docker run?
- With 8080:80 you expect that your application uses or start with the 80 internal port inside container.
- With 8080:8080 you expect that your application uses or start with the 8080 internal port inside container.
You just need to research what is the internal container port used by your jenkins and put it in docker run -p ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…