I’m hoping to more fully understand how docker-compose up works on a remote context so that I can debug an issue I have where docker-compose up crashes my jenkins instance without providing any errors. The pipeline I’m using can be summarised:
- Build locally using docker-compose build
- Tag and push images to private registry
- Change docker context to remote host
- Pull images from registry
- List all images (successfully shows my images on the remote host)
- And then deploy using docker-compose up
The issue I’m facing is that when the job reaches the docker-compose up command, jenkins says that is starting 2 of the 3 containers, but then crashes without errors. It makes the jenkins UI unresponsive, and sometimes completely freezes up the server until I reboot it.
My problem could be something separate, but I want to confirm that I’m using the docker-compose up command correctly, and I have raised a few questions:
- How does docker-compose up use the docker compose file? The docker-compose file isn’t on the remote host, it’s only stored locally, do I need to copy it over or does the docker context handle this?
- I’ve retagged the images I’ve created in order to push them to my registry, how is docker-compose up referencing the 3 images that I’ve created from the docker compose file. Do I need a second docker compose file that references the new image names in order to run the containers?