Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Docker Tip #77: Installing Docker on Debian Unstable

blog/cards/docker-tips-and-tricks.jpg

Installing Docker on Debian is normally a straight forward task, but if you want to use the unstable release you need to make a change.

Part of Docker’s installation steps involves adding their apt repository by running:

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"

On Debian stable, lsb_release -cs will report back jessie, stretch, buster or whatever happens to be the latest stable release. But on Debian unstable, that returns sid and Docker does not have an official repo set up for that release so it will fail.

Fixing the Docker installation error:

You can get around that by replacing $(lsb_release -cs) with stretch or whatever the latest stable release is and then continue installing Docker as usual. It works just fine.

Fixing an unexpected Docker Compose error:

If you happen to try and pip install --user docker-compose you may encounter an error of ImportError: No module named ssl_match_hostname whenever you run any Docker Compose command, such as docker-compose --version.

You can fix that by running sudo apt-get install python-backports.ssl-match-hostname.

Free Intro to Docker Email Course

Over 5 days you'll get 1 email per day that includes video and text from the premium Dive Into Docker course. By the end of the 5 days you'll have hands on experience using Docker to serve a website.



Comments