docker login
sudo docker login --username=Ryen registry.cn-hangzhou.aliyuncs.com
cat ~/.docker/config.json
``
## docker pull
## docker images
## docker push
## 从零开始学习 docker
```shell
docker
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
docker run -it ubuntu /bin/bash
exit
docker start b750bbbcfd88
后台运行
docker run -itd --name ubuntu-test ubuntu /bin/bash
docker attach
和 docker exec
docker attach 1e560fca3906
注意: 如果从这个容器退出,会导致容器的停止.
docker exec -it 243c32535da7 /bin/bash
docker export 1e560fca3906 > ubuntu.tar
docker import - test/ubuntu:v1
docker rm -f 1e560fca3906
docker port bf08b7f2cd89
docker logs -f bf08b7f2cd89
docker top wizardly_chandrasekhar
镜像操作
docker commit -m="updated" -a="adsryen" eb3c83541f05 adsryen/ubuntu
FROM centos:6.7
MAINTAINER Fisher "fisher@sudops.com"
RUN /bin/echo 'root:123456' |chpasswd
RUN useradd runoob
RUN /bin/echo 'runoob:123456' |chpasswd
RUN /bin/echo -e "LANG=\"en_US.UTF-8\"" >/etc/default/local
EXPOSE 22
EXPOSE 80
CMD /usr/sbin/sshd -D
Dockerfile
docker build -t runoob/centos:6.7 .
docker tag 860c279d2fec runoob/centos:dev
web 应用
docker run -d -P training/webapp python app.py
docker run -d -p 5000:5000 training/webapp python app.py
docker run -d -p 127.0.0.1:5001:5000 training/webapp python app.py
容器互联
docker run -d -P --name runoob training/webapp python app.py
docker network create -d bridge test-net
docker run -itd --name test1 --network test-net ubuntu /bin/bash
sudo docker logs -f -t --tail 10 s12