Better way to install Docker:
Recently I found that there is a better way to install
docker using just one command:
wget -qO- https://get.docker.com/ | sh
My Problem Solution: I have read many articles to solve the problem and I have learned so many things and the detailed solution is in this link.
The answer is that whenever I wanted to use apt-get it was locked. So I should kill the other processes that didn't let me to access the file. So by entering the following command you can see the processes and their numbers:
ps ax | grep -i apt
After seeing the processes ids, it's time for killing the processes by the following command:
sudo kill -9 <process id>
Eventually, I have run
docker run hello-world without any errors.
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
For more examples and ideas, visit: