Thursday, 1 November 2018

Docker CE on Ubuntu 18.10

That'll teach me to use the latest n' greatest Ubuntu 18.10 ( aka Cosmic ): -

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


Get:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease                                                  
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                                                          
Hit:4 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                            
Ign:5 https://download.docker.com/linux/ubuntu cosmic InRelease          
Err:6 https://download.docker.com/linux/ubuntu cosmic Release
  404  Not Found [IP: 13.35.198.99 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.


sudo apt-get update

Get:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease                                              
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                                                          
Hit:4 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                              
Ign:5 https://download.docker.com/linux/ubuntu cosmic InRelease
Err:6 https://download.docker.com/linux/ubuntu cosmic Release
  404  Not Found [IP: 13.35.198.85 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

Note that the add-apt command uses this: -

lsb_release -cs

which returns: -

cosmic

I checked this: -





which explains it - there's no stable release.

Easily hacked :-)

sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   bionic \
   stable"


Hit:1 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]
Get:3 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Get:4 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]                                                                         
Hit:5 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease           
Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [2,414 B]
Fetched 231 kB in 1s (405 kB/s)
Reading package lists... Done

which pulls the stable release from the bionic ( Ubuntu 18.04 ) release instead.

sudo apt-get update

Hit:1 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                              
Hit:3 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                                        
Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease                                                                                         
Get:5 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Fetched 164 kB in 1s (322 kB/s)                                
Reading package lists… Done


sudo apt-get install docker-ce

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  wmdocker
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  aufs-tools cgroupfs-mount git git-man liberror-perl pigz
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed
  aufs-tools cgroupfs-mount docker-ce git git-man liberror-perl pigz
0 to upgrade, 7 to newly install, 0 to remove and 5 not to upgrade.
Need to get 44.8 MB of archives.
After this operation, 230 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 aufs-tools amd64 1:4.9+20170918-2 [104 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 cgroupfs-mount all 1.4 [6,320 B]
Get:4 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 liberror-perl all 0.17026-1 [26.6 kB]
Get:5 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 18.06.1~ce~3-0~ubuntu [40.2 MB]
Get:6 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 git-man all 1:2.19.1-1ubuntu1 [822 kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 git amd64 1:2.19.1-1ubuntu1 [3,529 kB]
Fetched 44.8 MB in 42s (1,064 kB/s)                                                                                                                         
Selecting previously unselected package pigz.
(Reading database ... 133402 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../1-aufs-tools_1%3a4.9+20170918-2_amd64.deb ...
Unpacking aufs-tools (1:4.9+20170918-2) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../2-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../3-docker-ce_18.06.1~ce~3-0~ubuntu_amd64.deb ...
Unpacking docker-ce (18.06.1~ce~3-0~ubuntu) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../4-liberror-perl_0.17026-1_all.deb ...
Unpacking liberror-perl (0.17026-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../5-git-man_1%3a2.19.1-1ubuntu1_all.deb ...
Unpacking git-man (1:2.19.1-1ubuntu1) ...
Selecting previously unselected package git.
Preparing to unpack .../6-git_1%3a2.19.1-1ubuntu1_amd64.deb ...
Unpacking git (1:2.19.1-1ubuntu1) ...
Setting up aufs-tools (1:4.9+20170918-2) ...
Setting up docker-ce (18.06.1~ce~3-0~ubuntu) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Setting up git-man (1:2.19.1-1ubuntu1) ...
Setting up liberror-perl (0.17026-1) ...
Setting up cgroupfs-mount (1.4) ...
Processing triggers for libc-bin (2.28-0ubuntu1) ...
Processing triggers for systemd (239-7ubuntu10) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up pigz (2.4-1) ...
Setting up git (1:2.19.1-1ubuntu1) …

sudo docker version

Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:51 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:15 2018
  OS/Arch:          linux/amd64
  Experimental:     false

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...