Created
November 29, 2018 13:36
-
-
Save cbluth/4832ce37f7b158f88e2ba0e605ed009b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://aboutsimon.com/blog/2018/04/18/Ubuntu-Docker-Version-Pinning-for-Kubernetes.html | |
sudo apt install\ | |
apt-transport-https\ | |
ca-certificates\ | |
software-properties-common\ | |
curl | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt update | |
sudo apt install docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}') | |
If we would apt upgrade now, apt would suggest an update for Docker. One approach would be to apt-mark hold the current version, but apt would still say there is an update available, only not install it. Also, we wouldn’t get any fixes within the 17.03 version. | |
A better approach is to use apt pinning. | |
sudo su - | |
cat <<EOF > /etc/apt/preferences.d/docker | |
Package: docker-ce | |
Pin: version 17.03.* | |
Pin-Priority: 1000 | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment