15

I've noticed that Ubuntu 20.04 (Focal Fossa) comes with the latest docker engine ready to be installed.

On may/2020 if you do:

# apt update
# apt install -y docker.io

you get docker version 19.03.8 which, in turn, is the latest published (to the date) by the docker friends.

This is amazing! This installs both the latest engine and client from the ubuntu's standard package repos. Great!

But now... I want to have a client machine with only the docker client. I don't want the engine itself downloaded in this machine. Only the client part.

In the past

According to this https://docs.docker.com/engine/install/ubuntu/ until ubuntu 19.10 it seemed to exist docker-ce-cli.

But in a Focal Fossa 20.04 this happens:

# apt-get update
[omitted]
# apt-get install docker-ce-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce-cli

Question

What package should I install in ubuntu 20.04 to have only the docker cli?

# apt install -y xxxxxxxxx?
  • 3
    I believe the docker-ce-cli package is in a custom apt repository provided by docker.com, rather than a default repository. See: https://docs.docker.com/engine/install/ubuntu/ – Daniel Stevens Jan 29 '21 at 13:27

2 Answers2

4

As specified in the official source :

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Add the repository to Apt sources:

echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

To add repositories and package lists.

Then you can run :

sudo apt update
sudo apt install docker-ce-cli
  • Small extra step for Linux Mint users: The resulting /etc/apt/sources.list.d/docker.list file will contain the Linux Mint distro name (e.g. Mint 22 is "wilma"), but the Docker repo/PPA doesn't know Linux Mint distro names; replace the Mint distro name with the corresponding Ubuntu distro name (e.g. for Mint 22 it's "noble"). Find both the Mint and Ubuntu distro names for your system from the file /etc/os-release (see the lines for VERSION_CODENAME and UBUNTU_CODENAME). – Andrew Richards Nov 18 '24 at 15:23
0

Try this command

sudo apt-get install docker-ce-cli This might do what you need