I am able to run the image if I do:
sudo docker run -ti busybox /bin/sh
But if I create a service with the image it just continuously redeploys new containers and there are no logs in the containers if I do:
sudo docker service logs -f
or if I do the same for the servicename.
Is there something Im missing here? Are there some containers you can run but not deploy a service of?
I have the latest version of docker swarm running on ubuntu 18.04 gcloud vms and I am able to deploy other services such as the redis 3.0.6 shown in the docker service create documentation.
I finally figured it out. There were no error logs because there were no errors. If you run a docker container service with an empty ubuntu or busybox or a simple helloworld app that closes after running it just creates the container runs the app(if it exists) and the closes the container as soon as the app finishes executing.
Did this as a work around:
sudo docker service create ubuntu /bin/sh -c `“while true; do echo Hello; sleep 2; done”
Tested it and it works, the bash script keeps the containers open so I can use my ubuntu image to install networking tools for general debugging.
But, you could write your own Dockerfile that installs the networking tools, build that image and then start that one instead. Starting a clean ubuntu just to get into it and manually install stuff is not the most efficient way to do it imho.
Baby steps of a long and hard way around… that is the question.
If you know how to install the tools you want, creating a Dockerfile that does the provisioning for you is really easy.