32

I've installed Ubuntu 17.04 (VirtualBox). But since I have Ubuntu 17.04, it seems like docker is not yet available for Ubuntu 17.04. Is there any workaround to install Docker on Ubuntu 17.04?

This is my commande line history:

 2  curl -L https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&   chmod +x /tmp/docker-machine &&   sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
 3  docker-machine version
 4  docker pull ubuntu:latest
 5  sudo apt-get update
 6  sudo apt-get install     linux-image-extra-$(uname -r)     linux-image-extra-virtual
 7  sudo apt-get install     apt-transport-https     ca-certificates     curl     software-properties-common
 8  sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
 9  sudo apt-key fingerprint 0EBFCD88
10  lsb_release -cs
11  sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
12  sudo apt-get update
13  sudo apt-get install docker-ce -y

This is the actual error:

user@user-vm:~$ sudo apt-get update

Hit:1 http://ch.archive.ubuntu.com/ubuntu zesty InRelease
Hit:2 http://ch.archive.ubuntu.com/ubuntu zesty-updates InRelease       
Get:3 http://security.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]
Hit:4 http://ch.archive.ubuntu.com/ubuntu zesty-backports InRelease                 
Ign:5 https://download.docker.com/linux/ubuntu zesty InRelease                      
Ign:6 https://download.docker.com/linux/ubuntu zesty Release
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata                                                                                                                   
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons                                                                                                                      
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages                                                                                                                             
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages                                                                                                                           
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US                                                                                                                        
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en                                                                                                                          
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata                                                                                                                     
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata                                                                                                                   
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons                                                                                                                      
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages                                                                                                                             
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages                                                                                                                           
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US                                                                                                                        
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en                                                                                                                          
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata                                                                                                                     
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata                                                                                                                   
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons                                                                                                                      
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages                                                                                                                             
Err:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages                                                                                                                           
404  Not Found
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US                                                                                                                        
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en                                                                                                                          
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata                                                                                                                     
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata                                                                                                                   
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons                                                                                                                      
Fetched 89.2 kB in 12s (7'258 B/s)                                                                                                                                                                   
Reading package lists... Done
W: The repository 'https://download.docker.com/linux/ubuntu zesty Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://download.docker.com/linux/ubuntu/dists/zesty/stable/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

tutorial I was following

  • as of mid-2017, docker-ce 17.06 is available for Ubuntu 17.04 (it was released June 2017, and hence is version 17.06) -- just follow steps here: docs.docker.com/engine/installation/linux/docker-ce/ubuntu (and get docker-compose from pip (eg, sudo -H pip3 install docker-compose) and not from ubuntu repos, which are out-of-date. – michael Jul 31 '17 at 0:15
8

There is no official support of docker in Ubuntu 17.04 yet. An alternative is to download and install the binary of docker from https://github.com/moby/moby/releases.

For example if you want to install docker version 17.04.0-ce from binary, follow these steps:

$ wget https://get.docker.com/builds/Linux/x86_64/docker-17.04.0-ce.tgz
$ tar xzvf docker-17.04.0-ce.tgz
$ cd docker

This docker directory contains all the binaries. You need to add this directory to your PATH. You will need to manually start dockerd first. This page contains more details about how to install and run docker from a binary.

  • 1
    You can also just use the xenial repository, see my answer – bluehallu Apr 28 '17 at 14:11
  • Be aware that the get.docker.com packages are outdated, and that the .tgz archives contain statically linked binaries, which may not be what you want. Docker now has packages available for Ubuntu zesty; see docs.docker.com/engine/installation/linux/docker-ce/ubuntu. The installation script at get.docker.com is still up to date though, so running that will install the correct packages – thaJeztah Aug 8 '17 at 8:34
60

Docker hasn't setup a repository for the latest ubuntu, but that's an easy fix because their release for ubuntu 16 is compatible. For the time being, just edit /etc/apt/sources.list and on the line:

deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable

Replace zesty by xenial. Run sudo apt-get update and you can proceed with sudo apt-get install docker-ce

  • 4
    If you are adding this directly like I was you will want the PGP key for this repo - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7EA0A9C3F273FCD8 – timelf123 May 8 '17 at 15:50
  • @bluehallu: saw your edit, but I can't get it to work with today's repo. apt-get says there is no installation candidate for docker-ce – Thiago Arrais May 30 '17 at 13:06
  • @ThiagoArrais removed edit, I probably did something wrong when testing – bluehallu May 31 '17 at 15:59
  • works great if you add key server as @timelf123 mentioned – S.M.Mousavi Jun 14 '17 at 11:56
  • This answer is now out of date, but it didn't work for me, probably due to version mismatches (esp. docker-compose). But it's a moot point now that docker.com (not the ubuntu repos) has a docker-ce release 17.06 for Ubuntu 17.04. (These versions are a little confusing: docker-ce released in June of 2017 is v17.06). If installing docker-ce from docker.com, then docker-compose will have to be installed from docker-compose's git release, or via sudo -H pip install docker-compose, and not from ubuntu repos, which are now useless for docker related stuff (as of mid-2017). – michael Jul 31 '17 at 0:12
17

Just a quick note: Currently to install docker-ce on ubuntu 17.04 (zesty) you need to be on the edge channel: see https://github.com/moby/moby/issues/32423#issuecomment-300164496

Therefore you need to add deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty edge to your sources.

14

The information in this thready is outdated and can result in malfunctioning docker installation; ubuntu zesty is now supported, and packages are available; see the installation manual: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them:

$ sudo apt-get remove docker docker-engine docker.io

Automated Installation

If you want all the installation steps to be done "automatically", you can also use the installation script at https://get.docker.com/

Install Using the Repository

Update the apt package index:

$ sudo apt-get update

Install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.

$ sudo apt-key fingerprint 0EBFCD88

pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) <docker@docker.com>
sub   4096R/F273FCD8 2017-02-22

Use the following command to set up the stable repository (for the amd64 architecture):

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

INSTALL DOCKER CE

$ sudo apt-get update
$ sudo apt-get install docker-ce

Thanks Sebastiaan van Stijn for helping me with this.

4

I finally managed to make it work. Here's the solution that works for me:

  1. Use the solution proposed by Ravexina:

    sudo apt install docker.io

  2. Then use this :

    sudo gpasswd -a ${USER} docker

  3. Finally, reboot my system

Voilà ... it works perfect.

  • 4
    This will install the rather old version (currently 1.12.6-0ubuntu4) from the standard Ubuntu repository. If you follow the solution by @Georgi-Goranov, you will get the latest version (currently 17.05.0~ce-0~ubuntu-zesty). – Christopher K. Jun 2 '17 at 11:18
3
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D  
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-zesty testing'    
apt-get update    
apt-cache policy docker-engine    
apt-get install docker-engine
  • This will install docker-engine, not docker-ce – bluehallu Apr 28 '17 at 14:11
  • it is working for me – jijeesh Apr 28 '17 at 14:22
2

Just use following curl -fsSL https://get.docker.com/ | sh .. .. .. sudo usermod -aG docker $USER Source: https://github.com/moby/moby/releases/tag/v17.05.0-ce

0

On Ubuntu 17.04 the deb install from the official repo worked just fine (17.05)

https://github.com/moby/moby/releases/tag/v17.05.0-ce

0
#!/bin/bash
# file: src/bash/aspark-starter/install-docker-on-ubuntu-17.04.sh
# Purpose: 
# to automate the installation of docker-ce on Ubuntu 17.04 zesty
# 
# courtesy of https://askubuntu.com/a/944174/251228
set -eu -o pipefail # fail on error , debug all lines

# run as root
[ "$USER" = "root" ] || exec sudo "$0" "$@"

echo "=== $BASH_SOURCE on $(hostname -f) at $(date)" >&2

err_msg="\n\nthis script is only for Ubuntu 17.04 zesty, BUT you have: \n"$(lsb_release -a)
test $(lsb_release -cs) != "zesty" && echo -e "$err_msg"
test $(lsb_release -cs) != "zesty" && exit 1

echo Install Using the Repository
echo Update the apt package index:


apt-get update

echo Install packages to allow apt to use a repository over HTTPS:

apt-get install -y \
     apt-transport-https \
     ca-certificates \
     curl \
     software-properties-common


echo Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -


echo Verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.
apt-key fingerprint 0EBFCD88

echo << EOF_STDOUT
# the output should look like : 
# 
# pub   4096R/0EBFCD88 2017-02-22
# Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
# uid                  Docker Release (CE deb) <docker@docker.com>
# sub   4096R/F273FCD8 2017-02-22

EOF_STDOUT


echo Use the following command to set up the stable repository for the amd64 architecture
# src: https://unix.stackexchange.com/a/181538/37428
# tested only for amd64
arch=$(dpkg --print-architecture)
add-apt-repository \
    "deb [arch=""$arch""] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
    stable"

echo INSTALL DOCKER CE
sudo apt-get update
sudo apt-get install -y docker-ce

echo the docker binary is installed in
which docker

echo DONE !!!
# eof file src/bash/aspark-starter/install-docker-on-ubuntu-17.04.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.