Image
Search and Pull Image
$ docker search nginx
$ docker pull nginx
> $ docker pull registry.hub.docker.com/nginx:latest
$ docker images
> $ docker image ls
Inspect
$ docker inspect [name/id-prefix]
$ docker inspect [name/id-prefix] -f {{".Architecture"}} 2d696 # 指定要inspect的选项,前几个ID字符用于区分即可
Run
$ sudo docker run -t -i ubuntu /bin/bash
> $ sudo docker run -ti ubuntu /bin/bash
root@1b221667eebf:/# exit
exit
$ docker container ls [-a]
> $ docker ps [-a]
$ docker container stop eb...
Remove image
$ docker rmi [image:tag/id-prefix]
> $ docker image rm [image:tag/id-prefix]
// > $ docker rmi -f(--force) [image:tag/id-prefix]
Create Image
$ docker commit -m[--message=""] -a[--author=""] [-p:--pause=true] id-prefix name
visit here
Save and Load Image
$ docker save -o nginx_latest.tar nginx:latest
$ docker load < nginx_latest.tar
Push Image
$ docker tag test:tag user/repo:tag
$ docker push user/repo:tag
网友评论