Docker. Установка. Настройка. Использование. Базовые команды

OS	Ubuntu Server 24.04.4 LTS
Packets	apt-transport-https ca-certificates curl software-properties-common docker-ce docker-ce-cli containerd.io

Установка. Настройка

sudo apt update && sudo apt upgrade -y

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

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update && sudo apt install docker-ce docker-ce-cli containerd.io -y

sudo systemctl status docker

Если status docker выдает ошибку:

sudo systemctl status docker × docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Wed 2026-04-01 17:22:11 EEST; 1min 10s ago TriggeredBy: × docker.socket Docs: https://docs.docker.com Process: 72172 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 72172 (code=exited, status=1/FAILURE) CPU: 65ms Apr 01 17:22:11 mtx-test-2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3. Apr 01 17:22:11 mtx-test-2 systemd[1]: docker.service: Start request repeated too quickly. Apr 01 17:22:11 mtx-test-2 systemd[1]: docker.service: Failed with result 'exit-code'. Apr 01 17:22:11 mtx-test-2 systemd[1]: Failed to start docker.service - Docker Application Container Engine

То выполнить след:

sudo systemctl daemon-reexec sudo systemctl daemon-reload sudo systemctl restart docker.socket sudo systemctl restart docke

Для использования без sudo:

sudo usermod -aG docker $USER
newgrp docker
####or
sudo usermod -aG docker $USER
su - ${USER}
id -nG
sudo usermod -aG docker username

Проверка:

docker run hello-world

Работа с докером jooby-manager

Док: https://gitlab.infomir.dev/web/jooby/jooby-manager/-/blob/main/doc/updateMtxModule.md

Дополнительная документация находится в каталоге jooby-manager/doc

Перейди в каталог jooby-manager или jooby-manager-update. Выполнить:

git pull docker login docker.gitlab.infomir.dev docker pull docker.gitlab.infomir.dev/web/jooby/jooby-manager:latest

Для запуска обновления ПО модуля GSM/LORA_PLS перейти в каталог docker

Пример запуска:

GSM

./docker-run.sh updateMtxModule.js \ --path /dev/ttyUSB0 \ --baudrate 2400 \ --module GSM \ --image ../../img/GSM/mtx1/images254.14h33.5_encrypted.bin

LORA_PLC

./docker-run.sh updateMtxModule.js \ --path /dev/ttyUSB0 \ --baudrate 2400 \ --module LORA_PLC \ --image ../../img/LORA_PLC/mtx1/MTX_SY_PLCLORA_H03_S9B_28102025_encrypted.bin

Остановка контейнера. Пример:

$ docker ps -al CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bea02d01b40a hello-world "/hello" 10 days ago Exited (0) 10 days ago clever_lovelace $ docker stop bea02d01b40a