Install Docker In Linux


Install Docker In Linux

Install Docker In Linux

Install Docker on RHEL/CentOS/Fedora

In brief, after updated your system, you can simply type the follow commands:

sudo yum install docker-ce -y # install docker package
sudo service  docker start # start docker service
chkconfig docker on # start up automatically

FAQ

  1. If your SELinux and BTRFS are on working, you may meet an error message as follow:
# systemctl status docker.service -l
...
SELinux is not supported with the BTRFS graph driver!
...

Modify /etc/sysconfig/docker as follow:

# Modify these options if you want to change the way the docker daemon runs
#OPTIONS='--selinux-enabled'
OPTIONS=''
...

Restart your docker service

  1. Storage Issue: Error message found in /var/log/upstart/docker.log
[graphdriver] using prior storage driver \"btrfs\"...

Just delete directory /var/lib/docker and restart docker service

Install Docker on Ubuntu/Debian

Generally, you are supposed to add the repository, and then

sudo apt-get install docker-ce

Both Debian Series and RHEL Series can be controlled by

sudo service docker start # stop, restart, ...

Once you started your service, you would find a socket file /var/run/docker.sock, and then you would able to execute your docker commands.