How to update Docker on CentOS 7

      No Comments on How to update Docker on CentOS 7

I recently noticed that the Kubernetes guys are moving their container images from the Docker hub registry to their own repository…

image
A quick look tells me that Google now has it’s own image repository (gcr.io) so it seems to make sense that the Kubernetes team would be using that rather than the Docker hub registry.  That being said, I thought all I’d have to do was update my YAML files to point to the new location.  Unfortunately, that wasn’t the case.  After pushing the controller definitions to the Kubernetes cluster it became apparent that the containers were stuck in a pending state.  When I logged into one of the hosts and checked the Docker logs I saw the issue…

image 
After some digging, I found this…

image

Since the container image name had a ‘-‘ in it, Docker didn’t know what to do with it.  So the fix is to update Docker to the latest stable code which happens to be version 1.5.  In my case, the repositories I was using with YUM didn’t have 1.5 so we need to pull the latest binaries from Docker and use those.  To update, follow these steps…

#Stop the docker service
systemctl stop docker

#Pull down the latest binaries into the correct directory
#Check your systemd unit file to make sure you place these correctly!
wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker 

#Start docker 
systemctl start docker

Once it’s restarted you should be to check the version and make sure you’re running the newest code…

image
Now I just need to find a way to add a version check to my salt scripts…

Leave a Reply

Your email address will not be published. Required fields are marked *