To install Docker CE engine follow the instructions from the docker documentation: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce.
Important
|
For security reasons, it may be good idea not to add your user to the docker group.
Membership in the docker group essentially grants user the root permissions, without requiring to enter
password for privilege elevation (unlike sudo ).
|
Docker Compose [docker_compose] is a useful tool for deploying and managing multi-container workloads.
At the moment of writing, the preferred method of installation for Ubuntu was simply grabbing the latest binary from the GitHub releases page. The downside is that there won’t be any automatic upgrades and newer versions of Docker Compose will have to be installed manually.
Note
|
This guide has been updated to use Docker Compose v2 (complete rewrite of the Docker Compose in Golang). If you have older Docker Compose version, make sure you remove it and install the version 2. |
To find the latest Docker Compose version number, visit the GitHub releases page at: https://github.com/docker/compose/releases.
Next, download the docker-compose
binary:
sudo curl -L "https://github.com/docker/compose/releases/download/{COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/libexec/docker/cli-plugins/docker-compose # (1)
-
Replace
{COMPOSE_VERSION}
with the actual latest Docker Compose version.
And mark it as executable:
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose
Verify that Docker Compose works by doing:
docker compose version
Note
|
If you see an error similar to this:
error while loading shared libraries: libz.so.1: failed to map segment from shared object
then remove noexec option from the /tmp partition.
See [mounting_tmp_as_tmpfs] for more details.
|