Skip to content

Instantly share code, notes, and snippets.

@peterkappus
Last active May 13, 2018 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterkappus/b85930304354678c95b26cc5db6e47bc to your computer and use it in GitHub Desktop.
Save peterkappus/b85930304354678c95b26cc5db6e47bc to your computer and use it in GitHub Desktop.
Install Docker CE on RHEL/Centos (e.g. in a BBC VM)
# upgrade centos and make sure you have the docker repo
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# dunno why I had to do this but I did...any ideas?
sudo yum makecache fast
# Install these dependencies
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.33-1.git86f33cd.el7.noarch.rpm
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/pigz-2.3.3-1.el7.centos.x86_64.rpm
# Install docker-ce
sudo yum install -y docker-ce
# Start the daemon
sudo service docker start
# Add current user to the docker group
sudo usermod -a -G docker $USER
#NOTE : you'll need to do this for every user who needs to use docker...
# You may need to login to pull repos
sudo docker login
# Try it out
docker run hello-world
# Behind a proxy?
# Do this: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
# Add this:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
#need an HTTPS proxy?
sudo vim /etc/systemd/system/docker.service.d/https-proxy.conf
#add this:
[Service]
Environment="HTTPS_PROXY=http://proxy.example.com:80/"
# Reload the daemon to grab the new configs
sudo systemctl daemon-reload
# Restart docker (is this necessary after restarting the daemon?)
sudo systemctl restart docker
# Verify the configs are correct
systemctl show --property=Environment docker
# Now you should be able to grab whatever images you need.
# Have fun :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment