I am following the official tutorial of Docker.I typed the same code as the tutorial,but got an unexpected error as shown below.I checked the Dashboard and found the container had exited.The log is shown below,which was too complicated to understand for me.I wonder why this happens and how I can keep the container running without exiting unexpectedly.
Screenshot of the tutorial Screenshot of the CMD error message The Dashboard Log of the container
Updated:I used docker run -d --network todo-app --network-alias mysql -v todo-mysql-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=todos mysql:5.7 to successfully create the container.However,when I typeddocker exec -it <container-id> mysql -p,I got an unexpected error.Error response from daemon: Container <container-id> is not running.Above <container-id>s were all substituted correctly.
Reading your container logs, I spotted a line saying that the DB didn't shutdown correctly.
As a result the volume may have corrupted files? In your case the certificates.
Try clearing all data in the volume, destroy the container. And repeat the process from scratch
Related
I am trying to install Docker desktop on Mac m1 but after installation dockers asks to execute following command.
docker run -d -p 80:80 docker/getting-started
But, it gives following error
Unable to find image 'docker/getting-started:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": read tcp 192.168.65.4:58764->192.168.65.5:3128: read: connection reset by peer.
See 'docker run --help'.
Why is it not pulling docker data?
(Sorry for the miss... going to try this again)
Try docker exec command before your command.
Like this docker exec docker run -d -p 80:80 docker/getting-started
"Tried using the docker exec command and it appears to have worked OK with two different ubuntu instances. Did not try Docker Desktop.
It kind of looks like there is a problem with Docker Desktop manipulating Terminal.app.
I’m using the macOS default zshell."
https://forums.docker.com/t/problems-getting-started/116487/9
Error Response from daemon: Docker Container [id] is not running.
Hi Team,
I want to run my docker container from the docker reload script but getting the following error:-
Error response from daemon: Container b660899a0--- is not running
Please help as soon as possible. I'm stuck since 2-4 days
By default, the docker container will exit immediately if you do not have any task running on the container.
To keep the container running in the background, try to run it with the --detach (or -d) argument.
docker pull my_image
docker run -t -d --name my_app my_image
I installed Docker on a Windows 10 Pro system and grabbed the jenkins/jenkins:lts package to test out Jenkins stuff. It worked for a few days but then stopped launching because it's getting a permission denied error when trying to bind a port.
I've tried uninstalling/reinstalling the jenkins image in docker and uninstall/reinstall docker but nothing works now. It won't ever launch for me.
Here's what I use to run the image:
docker run --name=jenkins --hostname=jenkins -p 50000:50000 -p 8080:8080 jenkins/jenkins:lts
Here's the error I get:
docker run --name=jenkins --hostname=jenkins -p 50000:50000 -p 8080:8080 jenkins/jenkins:lts
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint jenkins (6615f4f62278459ed33a370bb7bf978e176e2831a7736d4a98d79181bb084c70): Error starting userland proxy: Bind for 0.0.0.0:50000: unexpected error Permission denied.
I'm going by what I'm seeing on the readme at the jenkins docker page:
https://github.com/jenkinsci/docker/blob/master/README.md
I'm not that great at troubleshooting things like this in Windows, but I did some basic stuff looking at the ports in use, etc. I don't see anything jumping out at me that looks like it's already in use.
I've also tried running this in an administrator command shell too but it's always denied.
I have deleted everything in my appdata too related to docker that I could find when I've tried this but it still won't work.
Any ideas on now to get this sorted out would be great. Any commands to force an unbind or how to -fully- remove docker since uninstalls never actually remove everything :/ would be really helpful.
Thanks!
I am using docker for first time. I created docker image for DB2 and when started to login to the instance using command,
sudo docker exec -i -t db2 /bin/bash
I got following error:
Error response from daemon: Container [id] is not running
I also tried to start the instance with:
sudo docker start [id]
It returned error message as:
Error response from daemon: driver failed programming external connectivity on endpoint db2 ([id]): Bind for 0.0.0.0:50000 failed: port is already allocated
Error: failed to start containers: [id]
Can someone help on this?
If you have a look to your error message, it shows that you're trying to run an entrypoint in a container [id] which uses port 50000, that is already being used.
That's why docker start [id] doesn't work.
This can be caused by several things (let me add some of them instead concrete which is the problem because you haven't expressed many details).
docker exec should be used with container id that are already running, not images, not entrypoints. So, maybe you missed do docker run before docker exec. Try to do docker run -it db2 /bin/bash if db2 is your docker image.
Other possibility is that your container started and entrypoint exited by any reason, without releasing port 50000. So, when you tried to re-launch without having released port, if container exited but wasn't removed, is not possible for other docker be started using this port. Let me recommend you to do docker container prune to clean exited previous containers.
Maybe you're starting two or more containers from the same image (maybe db2) without doing any port mapping. If you want to run several instances of the same docker image you can do two things:
Use docker swarm, kubernetes or similar to scale container (pod). It lets you use the same port 50000.
Use a port mapping in docker run command: For example,
for first container, do docker run -d -p 50001:50000 [docker-image] [entrypoint]
for second container, do docker run -d -p 50002:50000 [docker-image] [entrypoint]
In this way, you'll have several mappings from different ports to the same 50000 avoiding this error of port-reusing, but I'm not sure if this is what you want to do. I'm only trying to help you with the little information you provided.
I hope anyway it's helpful.
I used this command and got related response:
$ docker run -t -d -p 80:5004 myapp
a940b8bc522e593a83181ef95138f25dd1f3100bd6ff563d24eab7a265e9bd2a
But when I use docker ps to check the container see below response, it seems not correct (no see any info).
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
If I browse http://localhost/api/values on my host, I do not get the final result that I want.
Through the log I can see the error, but still not know how to fix it:System.InvalidOperationException: Unable to resolve project 'HelloMvc6' from /app/src/HelloMvc6
It seems that your container did not start properly and stopped immediately due to an error. You would probably see an exited container process when you type docker ps -a.
You can have a look at the containers console output using docker logs <containerId> to see what went wrong.
Hint: Usually you do not need the -t flag (tty) when you run the container detached in background with the -d flag.