docker 安装使用(Ubuntu 简单实操版)

1. 详细步骤

1.1 安装

sudo apt update
sudo apt install docker.io

1.2 验证(可跳过)

docker -v

1.3 使用

1.3.1 拉取镜像

# 镜像源,如使用腾讯云服务器,可使用 https://mirror.ccs.tencentyun.com
docker pull xxx

1.3.2 运行镜像

docker run -d --name container_name_xxx -p xxx:xxx -v /path:/path -e xxx=xxx image_name:tag

1.3.3 查看容器日志

docker logs container_name_xxx

1.3.4 停止容器

docker stop container_name_xxx

1.3.5 删除容器

docker rm container_name_xxx

1.3.6 删除镜像

docker rmi image_name:tag

2. 资源

2.1 菜鸟教程

2.1.1 镜像使用

https://www.runoob.com/docker/docker-image-usage.html

2.1.2 容器使用

https://www.runoob.com/docker/docker-container-usage.html

posted @ 2024-10-04 03:25  宇宙有只AGI  阅读(8)  评论(0编辑  收藏  举报