After my server rebooted, docker containers are still present in /var/lib/docker/containers but don't appear in docker ps -a and cannot be started by ID. Essentially, the data seems to exist but docker doesn't know it's there and/or doesn't know how to start it. For the record, the server is running Alpine Linux.
I tried calling docker start directly with the ID of a container and this was the output:
hostname:~# docker start 1d896bb6aa3b224fbfcaae92ad309bd99de5115fd557195ba309d760e729eac6/
Error response from daemon: No such container: 1d896bb6aa3b224fbfcaae92ad309bd99de5115fd557195ba309d760e729eac6
Error: failed to start containers: 1d896bb6aa3b224fbfcaae92ad309bd99de5115fd557195ba309d760e729eac6/
I've also tried creating new containers to see if they can be used and new containers seem to work fine, just the old ones are messed up.
Related
I am working on deploying a Joomla application on a Linux server using Docker. When I use the docker-compose start command, I get the following error:
Error
"Cannot start service joomla-1: get 7bc8fef95dc63f2c845e57c3b5be68cb872179c02b0db8eeed5468e57cce1484: no such volume"
I have checked the images are available.
This was working properly before, but suddenly stopped working. Can anyone help me on this?
There is something wrong with the container Volume. Try to delete your container first and then create it again.
docker container prune
and then
docker-compose up
I would like to restart a docker container, after exiting it and rebooting, with the same runtime with which it was initially created.
Here's what I did so far.
Create the container:
sudo docker run --runtime=nvidia [...]
Restart Docker after exiting the container and rebooting:
service docker restart
Restart the container previously created:
sudo docker start my_container
Reopen the container.
docker exec -it my_container [...]
The program which is then launched in the container doesn't use the Nvidia GPU as expected. It instead uses the system CPU.
Any help would be greatly appreciated.
I got the expected result by creating a new container with the --restart=unless-stopped policy, which lets Docker restart the container by itself when the Docker service is restarted. There seems to be more that's being done in this process than the start/exec sequence that I was using.
I'm working with Ubuntu 18 and I´m trying to run a dockerized nginx with a shared file between the host machine and the container: /home/ric/wrkspc/djangodocker/djangodocker/nginx.conf
I do so by running the following command, after which I'm prompted with container's ID:
$ sudo docker container run -v /home/ric/wrkspc/djangodocker/djangodocker/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
facc4d32db31de85d6f360e581bc7d36f257ff66953814e985ce6bdf708c3ad0
Now, if I try to list all the running containers, the nginx one doesn't appear listed:
(env) ric#x:~/wrkspc/djangodocker/djangodocker$ sudo docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36090ff0759c mysql "docker-entrypoint.s…" 3 days ago Up 3 days 0.0.0.0:3306->3306/tcp, 33060/tcp boring_panini
Sometimes, if I run the docker ls command fast enough, I can see the nginx container listed for just a few seconds and then it disappears.
Why is the nginx container not being listed?
I think container immediately exits after started.
can you troubleshoot by looking into docker logs using the command
docker logs containerID
Also, you can try running the container interactively to identify the error without using -d option
I'm new to using Docker and I am trying to follow a tutorial on this link which requires using a Docker. I have successfully installed the Docker on Ubuntu with the Docker docs tutorial.
I am following Option A and have completed steps 1,2, and 3. For 3 I had to precede the statement by sudo in order to get it work. However, when I try to run step 4 using the command docker run -it -p 8888:8888 -v <path to repo>:/root mlatberkeley/showandtell, I get the following error:
docker: Error response from daemon: driver failed programming external connectivity on endpoint eager_pasteur (fb195057d626924#####################3d3d6f24071497fc443fbd8c9): Error starting userland proxy: listen tcp 0.0.0.0:8888: bind: address already in use.
I have hashed some of the string of numbers above in the output error. I am new to Docker and I would be grateful for some suggestion to resolve the error.
There seems to be another process that is binded on port 8888.
To find this process run the command sudo netstat -tulpn | grep :8888. This will show you the process pid in the last column.
This might be a docker container that you have started previously. In that case try to remove the container by running docker container ls and then docker container rm -f <container-name-from-prev-command>. You can also start the new container on a new port, by replacing 8888:8888 with 9999:8888.
I am a newbiew to Docker. I am using Mac hence have installed Docker in HortonWorks Sandbox Virtual Box.
I am trying to create 2 containers out of a Ubuntu base image. One container runs nodejs on it and other with mysql.
I am able to create a container and it lists under Docker ps, but when I try to specify port for that container, it doesn't show me any error, but the port is not getting set.
Command used to add port to a running container:
docker run -p 8080:8080 nodejsapp
where node jsapp is my Image name of 1 container.
Any help would be really appreciated. Thanks.
It's hard to say without seeing your Dockerfile and without knowing what error messages you're seeing, but my guess is that you're not telling NodeJS what port to run on. The convention in NodeJS is to do this with the NODE_PORT environment variable:
docker run -e NODE_PORT=8080