moby: add-apt-repository fails on Raspbian (Jessie)


BUG REPORT INFORMATION

Description

Following the install steps at the docker install instructions page fails at step 3. However, Docker installs fine when using curl -sSL get.docker.com | sh

Steps to reproduce the issue:

  1. Clean install of Raspbian Jessie lite 2017-02-16 from the official source.
  2. Follow the install steps for Debian Stretch (Raspbian)
  3. At step 3, try running the Rasbian specific code: (lsb_release -cs returns “jessie”)
sudo add-apt-repository \
  "deb https://apt.dockerproject.org/repo/ \
  raspbian-$(lsb_release -cs) \
  main"
  1. You get error.

Describe the results you received:

pi@pi:~ $ sudo add-apt-repository \
>   "deb https://apt.dockerproject.org/repo/ \
>   raspbian-$(lsb_release -cs) \
>   main"
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 167, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 105, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 595, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/jessie
pi@pi:~ $ lsb_release -cs
jessie

Describe the results you expected: For the add-apt-repository command to succeed, and finish installing Docker.

Additional information you deem important (e.g. issue happens only occasionally): Running on a brand new Raspberry Pi 3 Model B I also had this same issue come up on one of my other Raspberry Pi’s, can’t remember if it was the first gen or another 3rd gen I have, but didn’t have time to debug then.

Edit: Typo fix

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 16
  • Comments: 29 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Normally I’m installing Docker with the following command on Raspbian Jessie (and LITE), which is therefore my recommended way:

curl -sSL https://get.docker.com | sh

This works w/o any issues!

I’ve managed to work around this by directly adding /etc/apt/sources.list.d/docker.list with deb https://apt.dockerproject.org/repo/ raspbian-jessie main in it. Don’t know whether the error with add-apt-repository command is a bug with software-properties-common or repo issue or what…

I think that bit was a typo. Here’s the output for the Raspbian instructions:

sudo add-apt-repository \
>        "deb https://apt.dockerproject.org/repo/ \
>        raspbian-$(lsb_release -cs) \
>        main"
[sudo] password for chep: 
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 167, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 105, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 595, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/jessie

There are valid armhf packages, and manually adding this:

deb [arch=armhf] https://download.docker.com/linux/raspbian stretch stable

to sources.list will work as expected.

(which is also what get.docker.com is doing).

The issue here really is with add-apt-repository.

As for the docs, they mention both add-apt and get.docker.com in the debian section as supported for raspbian.

https://docs.docker.com/install/linux/docker-ce/debian/

Either way, it’s not like a huge deal if you know your way around.

It’s just weird / inconvenient that add-apt would not work for raspbian/armhf.

On RPI3 with Raspbian Stretch, I had to manually add to “/etc/apt/sources.list”:

deb https://apt.dockerproject.org/repo/ debian-stretch main then running curl -sSL https://get.docker.com | sh worked for me

See my issues which are tracking this - https://github.com/alexellis/docker-arm/issues

Docker CE is on hold until at least 17.08 - so you must use 17.05 if you want a fully-working installation. The binaries will go into Jessie or Stretch. If you really want latest it means rebuilding from scratch and adding in the Moby PR mentioned in the repo above.

Also, https://docs.docker.com/engine/installation/linux/raspbian redirects to https://docs.docker.com/engine/installation/linux/debian, so it would appear that the debian page is intended to provide instructions for raspberry pi.

@DieterReuter that works. So not sure what the point is of leaving up broken instructions.