# docker

## Install docker on centos 7

### First step: install docker

使用官方安装脚本自动安装，十分简易。

```bash
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
```

### Second step: instasll nvidia-docker

```bash
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo

sudo yum install -y nvidia-container-toolkit
```

### Third step: run docker

```bash
sudo systemctl restart docker
```

### Final step: run nvidia-docker

```
docker run --gpus '"device=1,2"' [image_name] [CMD]
```

### Reference:

{% content-ref url="/pages/-MDzS0VE38lIF7Ip0Psb" %}
[Broken mention](broken://pages/-MDzS0VE38lIF7Ip0Psb)
{% endcontent-ref %}

{% content-ref url="/pages/-MDzSK5XNtc5MYaRerGQ" %}
[Broken mention](broken://pages/-MDzSK5XNtc5MYaRerGQ)
{% endcontent-ref %}


---

# 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://qihao.gitbook.io/qtt/tools/docker.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.
