7bb319d26c0d7ea9f0953285b7b9962a4ad1e1d3048ab1785d8c3d7e1ed346fc
Error response from daemon: Container 7bb319d26c0d7ea9f0953285b7b9962a4ad1e1d3048ab1785d8c3d7e1ed346fc is not running
Exited with code 1
The entrypoint is ENTRYPOINT [/commowand-api-gin]
It is just a binary file. I had an error in the app which made the container exits which I noticed once I tried running it locally and the error was displayed in stdout (not the case on circleci, not sure why). I also realized my image had not curl installed. Sorry I am new to docker.
Now the container runs properly and I am trying to curl it from a secondary container, both being part of the same network, like so:
$ docker network create cmwd-net
$ docker run --network cmwd-net -d -p 8084:80 --name web andreacab/commowand-api-gin:$CIRCLE_SHA1
With:
docker inspect cmwd-net
I can see that the container web is part of the network with the right name.
Also with:
It looks like that should work - you have joined each container to a common network, and each container should get a network name equivalent to their container name.
To debug this, I’d suggest a couple of things to try:
Get your containers running in Docker Compose - this does the network joining automagically
Consider getting each container to run in a long-running fashion without giving them commands to run, and then use SSH to drop into a container you want to exec commands in. This will give you an environment to test stuff in dynamically.
Try pinging one container from another using the container’s name - that should work
Try getting this working in Docker locally to see if it is a CircleCI-specific issue
Hey Halfer thanks for your message, ssh’ing into it proved it worked!
I did run the second container with the option --entrypoint /bin/sh, ssh’ed into it as suggested, and ran the curl commands in there and perfectly worked. The web host was successfully resolved. It seems the container does not get the host names mapping in /etc/hosts straight away.