# 5. Cài đặt docker, docker-compose

### **Bước 1: Thực hiện install các gói cần thiết**

`sudo yum install -y yum-utils`

&#x20;`sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo`

### Bước 2: Cài đặt docker và docker compose

`sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin`

*Nếu cần nhập GPG key thì điền thông tin sau:*

*`060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35`*

### Bước 3: khởi chạy docker

`sudo systemctl  enable docker`

`sudo systemctl start docker`

Thêm người dùng vào nhóm docker

`sudo usermod -aG docker $(whoami)`

### Bước 4: Cấu hình docker

* Server triển khai cần được cài đặt docker
* Tạo file daemon.json nếu chưa tồn tại

  `sudo nano /etc/docker/daemon.json`
* Đăng ký insecure bằng cách thêm cấu hình sau vào file daemon.json

  `{`

  `"insecure-registries" : ["repo.viettelsoftware.com:8088"]`&#x20;

&#x20;   `}`

* Restart lại docker

  `sudo systemctl restart docker`

### Bước 5: link tham khảo

[`https://docs.docker.com/engine/install/centos/`](https://docs.docker.com/engine/install/centos/)


---

# 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://docs.viettelsoftware.com/huong-dan-cai-dat/5.-cai-dat-docker-docker-compose.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.
