Docker
2016-05-23 18:08
537 查看
Install:
安装完成后需要sudo usermod -aG docker [user]后重新登录,以非root用户使用docker。
docker run command时,报docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?检查docker是否已启动,ps -aux | grep docker,若已启动依然报此错误,一般是用户导致的,可sudo执行,或添加docker用户。
docker run hello-world
run:创建并运行一个docker container,container是极简的linux操作系统
hello-world:加载名为hello-world的image进这个container,image是加载进container的程序
Docker Hub:全球共享docker image库。
构建image:
mkdir mydocker && cd mydocker
vim Dockerfile
docker build -t docker-whale . # 读取当前目录下的Dockerfile,构建名为docker-whale的image
docker run docker-whale
docker images
# REPOSITORY TAG IMAGE ID CREATED SIZE
# docker-whale latest bd523f778016 About an hour ago 274.5 MB
# hello-world latest 94df4f0ce8a4 3 weeks ago 967 B
# docker/whalesay latest 6b362a9f73eb 12 months ago 247 MB
docker tag bd523f778016 [account]/docker/whalesay latest # 用image-id和docker-hub-account和image名称标记image
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
# docker-whale latest bd523f778016 About an hour ago 274.5 MB
# yimzncy/docker-whale latest bd523f778016 About an hour ago 274.5 MB
# hello-world latest 94df4f0ce8a4 3 weeks ago 967 B
# docker/whalesay latest 6b362a9f73eb 12 months ago 247 MB
sudo docker login --username=[account] --email=[account]@gmail.com # 登录docker hub
docker push docker/whalesay # push image
docker rmi -f bd523f778016/docker-whale # 删除image可用id或name
docker run [account]/docker/whalesay # pull && load image
MORE:
https://docs.docker.com/docker-hub/
安装完成后需要sudo usermod -aG docker [user]后重新登录,以非root用户使用docker。
docker run command时,报docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?检查docker是否已启动,ps -aux | grep docker,若已启动依然报此错误,一般是用户导致的,可sudo执行,或添加docker用户。
docker run hello-world
run:创建并运行一个docker container,container是极简的linux操作系统
hello-world:加载名为hello-world的image进这个container,image是加载进container的程序
Docker Hub:全球共享docker image库。
构建image:
mkdir mydocker && cd mydocker
vim Dockerfile
docker build -t docker-whale . # 读取当前目录下的Dockerfile,构建名为docker-whale的image
docker run docker-whale
docker images
# REPOSITORY TAG IMAGE ID CREATED SIZE
# docker-whale latest bd523f778016 About an hour ago 274.5 MB
# hello-world latest 94df4f0ce8a4 3 weeks ago 967 B
# docker/whalesay latest 6b362a9f73eb 12 months ago 247 MB
docker tag bd523f778016 [account]/docker/whalesay latest # 用image-id和docker-hub-account和image名称标记image
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
# docker-whale latest bd523f778016 About an hour ago 274.5 MB
# yimzncy/docker-whale latest bd523f778016 About an hour ago 274.5 MB
# hello-world latest 94df4f0ce8a4 3 weeks ago 967 B
# docker/whalesay latest 6b362a9f73eb 12 months ago 247 MB
sudo docker login --username=[account] --email=[account]@gmail.com # 登录docker hub
docker push docker/whalesay # push image
docker rmi -f bd523f778016/docker-whale # 删除image可用id或name
docker run [account]/docker/whalesay # pull && load image
MORE:
https://docs.docker.com/docker-hub/
相关文章推荐
- docker管理容器的数据(VOLUMNS)
- docker-初级教程
- Ubuntu14.04下安装docker
- 在Linux上安装docker
- centos 7 安装与配置docker
- Docker简介
- docker --- 初识
- 阿里云Ubuntu环境搭建Docker服务
- Docker简明教程
- Docker安装详细步骤(CentOS环境)
- 在Docker下搭建Spark+HDFS集群
- docker学习(2)基本命令
- docker学习(1)docker的安装
- Docker1.10.1以上版本配置http API访问
- 利用Docker云计算把家里的电脑变成网站服务器
- ssh登录docker容器
- 工具-docker01
- 深入理解Docker Volume(二)
- 升级centos6.5内核至3.10及安装docker
- Docker容器基础认知