docker
Docker
Install Docker Desktop on Debian | Docker Documentation
Install Docker Engine on Debian
Install Docker Engine on Debian | Docker Documentation
Set up the repository
1.Update the apt
package index and install packages to allow apt
to use a repository over HTTPS:
1 | sudo apt-get update |
2.Add Docker’s official GPG key:
1 | sudo mkdir -p /etc/apt/keyrings |
3.Use the following command to set up the repository:
1 | echo \ |
Install Docker Engine
1.Update the apt
package index, and install the latest version of Docker Engine, containerd, and Docker Compose, or go to the next step to install a specific version:
1 | sudo apt-get update |
修改Docker Hub镜像源
在配置文件 /etc/docker/daemon.json
中加入:
Docker Hub 源使用帮助 — USTC Mirror Help 文档
1 | { |
1 | { |
重新启动 dockerd:
1 | sudo systemctl restart docker |
Install Docker Compose CLI plugin
Install Docker Compose CLI plugin | Docker Documentation
1.Docker Compose V2 Install using the repository
1.Update the apt
package index, and install the latest version of Docker Compose:
1 | sudo apt-get update |
2.Compose Switch
Compose Switch is a replacement to the Compose V1 docker-compose
(python) executable. It translates the command line into Compose V2 docker compose
then run the latter.
docker/compose-switch (github.com)
1 | curl -fL https://raw.githubusercontent.com/docker/compose-switch/master/install_on_linux.sh | sh |
2.Docker Compose V1
1 | curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose |
Docker指令
复制容器文件
1 | docker ps -a |
常用镜像
1.portainer
1 | docker run -d --name=prtainer --restart=always \ |