将docker镜像上传到阿里云镜像仓库
docker tag 镜像ID REPOSITORY:[镜像版本号]
docker push REPOSITORY:[镜像版本号]
从阿里镜像仓库获取
docker pull REPOSITORY:[镜像版本号]
登录阿里云
docker login --username=[username] registry.cn-hangzhou.aliyuncs.com
相关命令
- 将主机/www/runoob目录拷贝到容器96f7f14e99ab中,目录重命名为www。
docker cp /www/runoob 96f7f14e99ab:/www
rpm -qa | grep jdk //查询是否存在jdk
docker rm 容器id //删除docker 容器
docker rmi 镜像id //删除docker 镜像
使用URL github.com/creack/docker-firefox 的 Dockerfile 创建镜像。
docker build github.com/creack/docker-firefox
docker start/stop/restart 容器name //启动停止重启 一个容器
docker bulid [options] path
docker run -d -p 8000:8080 --name test-tomcat centos-tomcat:v1 创建一个容器
-d 后台运行
-p 宿主机port:容器port 端口映射
--name 容器名称, 可以通过容器名称对容器操作
docker exec -it 镜像ID /bin/bash 进入一个已经运行的容器