#查看 Docker 版本
docker -v
sudo docker pull 仓库/镜像:版本(留空的话默认为 latest)
sudo docker run 加参数,用来创建容器
#查看运行容器
sudo docker ps
#查看所有下载的镜像
sudo docker images
#进入容器终端
sudo docker exec -i -t ha /bin/bash
#实时查看10行的 ha 日志
sudo docker logs -f -t --tail 10 ha
#重启 systemctl 守护进程
sudo systemctl daemon-reload
#设置 Docker 开机启动
sudo systemctl enable docker
#开启 Docker 服务
sudo systemctl start docker

#下载 Docker 图形化界面 portainer
sudo docker pull portainer/portainer
#创建 portainer 容器
sudo docker volume create portainer_data
#运行 portainer
sudo docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer


#新建容器并自启
docker run --restart=always 容器ID 或 容器名称

#更新容器为自启
docker update --restart=always 容器ID 或 容器名称

#更新容器为取消自启
docker update --restart=no 容器ID 或 容器名称


#我的备份命令小本本

docker run -d -p 8080:8080 -p 1080:1080 --name xray --restart=always -v $PWD:/etc/xray teddysun/xray

docker run -itd -p 8888:8888 --name jupyter ubuntu/jupyter /bin/bash -c "jupyter notebook"

docker run -itd --name jupyter --restart=unless-stopped -p 8888:8888 -v $PWD:/jupyter ubuntu/jupyter /bin/bash -c "jupyter notebook"

docker run -itd --name kplayer --restart=unless-stopped -p 4155:4155 -p 4156:4156 -v $PWD/video:/video  -v $PWD/config.json:/kplayer/config.json  bytelang/kplayer:latest

docker run --rm --name kplayer_debug -p 4155:4155 -p 4156:4156 -v $PWD/video:/video  -v $PWD/config.json:/kplayer/config.json -it bytelang/kplayer:latest /usr/bin/kplayer play start --home /kplayer --log_level debug

docker run -d -p 1935:1935 --name nginx-rtmp aricodes/nginx-rtmp

docker run --gpus all -itd --name jupyter --restart=unless-stopped -p 8888:8888 \
-v $PWD/jupyter_notebook_config.py:/root/.jupyter/jupyter_notebook_config.py \
-v $PWD/jupyter_notebook_config.json:/root/.jupyter/jupyter_notebook_config.json \
-v $PWD:/jupyter \
ubuntu/jupyter /bin/bash -c "jupyter notebook"


#更换源
nano /etc/docker/daemon.json
{
    "registry-mirrors" : [
    "https://registry.docker-cn.com",
    "https://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn"
  ]
}

#挂载webdav
apt-get install davfs2
mkdir /mnt/webdav
mount -t davfs https://webdav.yandex.ru /mnt/webdav

#wget代理下载
wget -e http_proxy=172.17.0.1:8080 -e https_proxy=172.17.0.1:8080 --no-check-certificate https://***




Powered by NoderCMS