Docker on CentOS 7
December 7 2016110 words, ~1 min. read
centos, docker
Steps
- Update packages
sudo yum update -y - Enable proxy
export https_proxy=http://proxy.sbchand.net:8080 - Install docker engine
curl -fsSL https://get.docker.com/ | sh - Enable user permissions (optional)
sudo usermod -aG docker sbchand - Logout and login (preferred)
- Start docker
sudo systemctl start docker - Ensure docker is running
sudo systemctl status docker - Enable docker on every reboot
sudo systemctl enable docker - Try docker info
docker info - Try hello world
docker run hello-world
NOTE: If you are behind proxy, try the following,
- Create docker service configuration file
mkdir /etc/systemd/system/docker.service.d
touch /etc/systemd/system/docker.service.d/http-proxy.conf
- Configure proxy in the above configuration file,
[Service]
Environment="HTTP_PROXY=http://proxy.sbchand.net:8080/" "NO_PROXY=localhost,127.0.0.1,hub.docker.sbchand.net"
- Flush changes
systemctl daemon-reload - Verify new configuration
systemctl show --property=Environment docker - Restart docker
systemctl restart docker