wget -qO- get.docker.com | bash
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get update && apt-get install docker-ce docker-ce-cli containerd.io
https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/
https://docs.docker.com/engine/install/ubuntu/
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf list docker-ce
dnf install docker-ce --nobest -y
https://linuxconfig.org/how-to-install-docker-in-rhel-8
systemctl start docker
systemctl enable docker
yum remove docker-ce
https://docs.docker.com/install/linux/docker-ce/centos/
systemctl daemon-reload
systemctl restart docker.service
vi /etc/docker/daemon.json
{
"registry-mirrors": [ "https://dockerpull.com" ]
}
systemctl restart docker
systemctl stop docker.service
mv /var/lib/docker /package/docker-data
vi /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --graph /package/docker-data
systemctl daemon-reload && systemctl restart docker.service
docker info | grep Dir
docker -v
docker ps
docker ps -a
docker rm 容器ID
docker exec -it 容器ID /bin/bash
docker exec -it 容器ID /bin/bash -c "date"
docker start 容器ID或容器名
docker stop 容器ID或容器名
docker stop -t=60 容器ID或容器名
docker kill 容器ID或容器名
docker restart 容器ID或容器名
docker images
docker rmi 镜像ID
docker search 关键字
docker pull 镜像名称
docker run -it 镜像名称 /bin/bash
docker tag 镜像ID 仓库:标签
docker build -t 包名:tag .
docker run -p 8080:80 --name 别名 镜像ID
docker logs -f $ID
docker cp 容器ID:/etc/hosts /tmp
docker cp /tmp/a.txt 容器ID:/tmp
docker volume ls
docker volume inspect 6ce358b6561136550039f9ec640b1aa0c89dfd05e5ea1c2ec4e2f8a7e37ca011
docker volume rm 6ce358b6561136550039f9ec640b1aa0c89dfd05e5ea1c2ec4e2f8a7e37ca011
docker run -v /netnr:/netnr -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d justin2004/mssql_server_tiny
https://blog.csdn.net/fanxl10/article/details/83818402
docker container update --restart=always 容器ID
docker update --restart=no 容器ID
systemctl stop docker
cd /var/lib/docker/containers && ls -lh
docker ps -a
vi hostconfig.json
vi config.v2.json
systemctl start docker
https://www.hangge.com/blog/cache/detail_2411.html
docker export 容器ID > cbox.tar
docker import - new_cbox < cbox.tar
docker save -o imagebox.tar <Repo:Tag>
docker save -o ibox.tar postgres:9.6 mongo:3.4
docker load < ibox.tar
docker tag <Image-ID> <NewName:Tag>