Bala's Blog

Docker on CentOS 7

December 7 2016
110 words, ~1 min. read
centos,  docker 

Steps

  1. Update packages sudo yum update -y
  2. Enable proxy export https_proxy=http://proxy.sbchand.net:8080
  3. Install docker engine curl -fsSL https://get.docker.com/ | sh
  4. Enable user permissions (optional) sudo usermod -aG docker sbchand
  5. Logout and login (preferred)
  6. Start docker sudo systemctl start docker
  7. Ensure docker is running sudo systemctl status docker
  8. Enable docker on every reboot sudo systemctl enable docker
  9. Try docker info docker info
  10. Try hello world docker run hello-world

NOTE: If you are behind proxy, try the following,

  1. Create docker service configuration file
mkdir /etc/systemd/system/docker.service.d
touch /etc/systemd/system/docker.service.d/http-proxy.conf
  1. 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"
  1. Flush changes systemctl daemon-reload
  2. Verify new configuration systemctl show --property=Environment docker
  3. Restart docker systemctl restart docker