Docker 常见的用法

广告位

操作 命令 备注 通过脚本安装Docker curl -fsSL get.docker.com -o get-docker.sh sudo sh get-docker.sh –mirror Aliyun 启动docker服务 systemctl enable docker systemctl start docker 列出docker docker ps 7 启动docker docker start ID 7 为当前容器生成备份 docker commit -p 7 搜索Docker镜像 docker search 7 从Docker镜像仓库中拉取镜像 docker pull 7 将images导出为文件 docker save -o <~/path_to_container-backup.tar> 7 将images从文件导入 docker load -i <~/path_to_container-backup.tar> 7…

操作 命令 备注
通过脚本安装Docker curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh –mirror Aliyun
启动docker服务 systemctl enable docker
systemctl start docker
列出docker docker ps 7
启动docker docker start ID 7
为当前容器生成备份 docker commit -p 7
搜索Docker镜像 docker search 7
从Docker镜像仓库中拉取镜像 docker pull 7
将images导出为文件 docker save -o <~/path_to_container-backup.tar> 7
将images从文件导入 docker load -i <~/path_to_container-backup.tar> 7
进入到容器中 docker exec -it df5bbb118286 /bin/bash 7
开机启动 docker update –restart=always 7
安装docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
7
juanhao.z

关于作者: juanhao.z

为您推荐

广告位

Leave a Reply

Your email address will not be published. Required fields are marked *