# Модуль В. Docker-compose, создание локального docker registry

#### Задание:

1\. На машине ControlVM.

* 1\. Установите Docker и Docker Compose.
* 2\. Создайте локальный Docker Registry.

#### Выполнение:

**ControlVM:**

* Устанавливаем Docker и Docker Compose:

```
sudo apt-get update && sudo apt-get install -y docker-{ce,compose}
```

* Включаем и добавляем в автозагрузку службу **docker**:

```
sudo systemctl enable --now docker.service
```

* Добавляем пользователя **altlinux** в группу **docker**:

```
sudo usermod -aG docker altlinux
```

* Завершаем текуший сеанс пользователя **altlinux**:

```
exit
```

* Подлючаемся к **ControlVM** вновьи проверяем запуск команд docker от пользователя altlinux:

![](https://sysahelper.ru/pluginfile.php/304/mod_page/content/2/image.png)

* Создаём и запускаем локальный **Docker Registry**:
  * поднимает **контейнер Docker** с именем **DockerRegistry** из образа **registry:2**. Контейнер будет слушать сетевые запросы **на порту 5000**, а параметр **--restart=always** позволит автоматически запускаться контейнеру после перезагрузки сервера.

```
docker run -d -p 5000:5000 --restart=always --name DockerRegistry registry:2
```

* Проверяем:

<img src="https://sysahelper.ru/pluginfile.php/304/mod_page/content/2/image%20%281%29.png" alt="" height="215" width="932">

Последнее изменение: четверг, 15 февраля 2024, 16:41


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://seraphim.gitbook.io/volodyazetkin2024gitbook/modul-v.-docker-compose-sozdanie-lokalnogo-docker-registry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
