Установка Docker на Debian 12

Обновление системы

Перед установкой Docker убедитесь, что ваша система Debian обновлена, с помощью следующей команды:

sudo apt update && sudo apt upgrade -y

Если получите ошибку "sudo: command not found" То необходимо выполнить команду:

apt-get install sudo -y

Установка Docker на Debian 12

После обновления вашей системы установите необходимые пакеты, чтобы apt мог использовать репозиторий по протоколу HTTPS:

sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2 -y

Затем добавьте официальный GPG-ключ Docker:

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

Добавьте репозиторий Docker в APT sources:

echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list

Обновите индекс вашего пакета и установите Docker CE (Community Edition):

sudo apt update && sudo apt install docker-ce -y

Чтобы убедиться, что Docker запускается при загрузке, используйте следующую команду:

sudo systemctl enable docker

Проверьте установку Docker, запустив образ hello-world:

sudo docker run hello-world

Если, Docker установлен правильно, то вывод должен получиться таким же:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:94323f3e5e09a8b9515d74337010375a456c909543e1ff1538f5116d38ab3989
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Установка Portainer на Debian 12

Теперь, когда Docker запущен, установим Portainer. Сначала создайте том, который сервер Portainer будет использовать для хранения своей базы данных:

docker volume create portainer_data

Затем загрузите и установите серверный контейнер Portainer:

docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Сервер Portainer теперь установлен. Вы можете проверить, запущен ли контейнер сервера Portainer, выполнив команду docker ps.
Для входа в систему используем адрес:

https://localhost:9443 или https://IP адрес сервера:9443

Установка Docker Compose в Debian 12

https://dockerhosting.ru/blog/ustanovka-docker-na-debian-12/

 

 

<< Назад

Наверх