Starting out with docker and docker-compose. Installation in ubuntu/debian based.

Note: all meant to be done as root or with root privileges.

Update everything.

# apt-get update
# apt-get upgrade

Install prerequisites:

# apt install apt-transport-https ca-certificates curl software-properties-common

GPG key and official docker repo:

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

Para ubuntu focal fossa (20.04.x)
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

Para debian bullseye (debian 11)
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable"

Para debian bookworm (debian 12)
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian bookworm stable"

# apt update

Install docker and docker-compose

# apt-get install docker-ce docker-compose

Post install tasks to avoid using sudo or root to manage docker containers:

# usermod -aG docker pep
* or do it for your user using sudo
# sudo usermod -aG docker $USER

Log out, log back in so all the permissions and stuff are applied.

Then we check if docker is running properly. Do this from your user, not root.

# docker run hello-world

And done!

Refs:

Un comentario en “Starting out with docker and docker-compose. Installation in ubuntu/debian based.

Deja un comentario