I can confirm that rolling back to 20.10.5
resolves this issue.
For those interested in the steps to roll back, I’ve included them below. These are the steps I followed, perhaps there are more efficient or elegant methods.
In short you will first “blacklist” the 20.10.6
version, then remove docker-ce
and related packages and finally re-install docker. Due to the blacklist, the last step will install the 20.10.5
version (at the time of writing).
When later 20.10.7
comes out you should be able to run apt upgrade
without an issue (not tested myself).
Find the exact version name to exclude
This command lists all versions of docker-ce
that the apt
command can install.
sudo apt-cache madison docker-ce
You’re looking for the string in the second column, looking something like 5:20.10.6~3-0~ubuntu-focal
.
Configure apt to ignore version 20.10.6
There are different methods, I chose apt pin
using preference files.
Below commands are specifically for Ubuntu Focal, in the previous command you can find
the version string that is applicable in your case. Replace the string 5:20.10.6~3-0~ubuntu-focal
accordingly.
You probably need root access to write to /etc/apt/preferences.d/
echo -e "Package: docker-ce\nPin: version 5:20.10.6~3-0~ubuntu-focal\nPin-Priority: -10" > /etc/apt/preferences.d/docker-ce
echo -e "Package: docker-ce-rootless-extras\nPin: version 5:20.10.6~3-0~ubuntu-focal\nPin-Priority: -10" > /etc/apt/preferences.d/docker-ce-rootless-extras
echo -e "Package: docker-ce-cli\nPin: version 5:20.10.6~3-0~ubuntu-focal\nPin-Priority: -10" > /etc/apt/preferences.d/docker-ce-cli
Stop docker
sudo systemctl stop docker
Remove docker-ce
and related from your system
sudo apt remove "^docker-ce.*"
This allows you confirm if the pins set earlier are in effect
sudo apt-cache policy "^docker-ce.*"
This should show for docker-ce
, docker-ce-rootless-extras
and docker-ce-cli
that version 20.10.6
has a priority of -10, while other version have a positive number, e.g. 500.
Install docker
again.
This should also install the required components. Note that it should install 20.10.5
.
If not, I don’t know what went wrong.
sudo apt install docker-ce
Reboot
I tried simply restarting the service, but that gave me errors.
After a reboot (sudo reboot
) the docker service was started and I could expose ports again without having to do any other workarounds.