Stranger
Stranger

Reputation: 10621

How to stop docker pull

I have just started learning docker. In a tutorial, I saw the docker pull command which can be used like docker pull container-name to pull the respective container from the docker hub repository.

But in case, if you cancel the pull by using "Ctrl + C", it is exiting from the ongoing progress but not stopping the download which I was confirmed by using nethogs which is showing, Nethogs docker progress

I searched in Google for the same. But I couldn't see any useful information regarding this. What is the right way of cancelling the docker pull? Please help.

Upvotes: 12

Views: 14442

Answers (2)

the pickle
the pickle

Reputation: 677

It has been a year since the original post. UPDATE now if you just press Ctrl-C it will kill the actual docker pull process

This also works with the engine API. If you pull the container and read stream, destroying the read stream will stop the pull process

Upvotes: 12

user2915097
user2915097

Reputation: 32176

There is no direct way to stop the ongoing process of docker pull as of now. You should restart the docker service by using,

sudo service docker restart

This will stop the ongoing pull of docker. For more details please check this github docker issue, https://github.com/docker/docker/issues/6928

CAUTION: This command will stop all the running containers in the system

Upvotes: 18

Related Questions