赞
踩
1. docker create [OPTIONS] IMAGE [COMMAND] [ARG...] create one container.
- $ docker create --name looper busybox /bin/sh -c 'sleep 10 && echo 1234'
- $ docker start looper
2. docker stats show containers' usage statistic like linux command top
- $ docker stats
- $ docker container stats
- $ docker stats CONTAINER-NAME
- $ docker container stats CONTAINER-NAME
3. docker attach [OPTIONS] CONTAINER
Attach local standard input, output, and error streams to a running container.
If --sig-proxy is true (the default),CTRL-c sends a SIGINT to the container
If the container was run with -i and -t, you can detach from a container and leave it running using the CTRL-p CTRL-q key sequence
4. docker cp Copy files/folders between a container and the local filesystem
- docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
- docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
5. docker events
Get real time events from the server like command git reflog. It return all action of docker server, ps, docker attach, docker stop.
6. docker history IMAGE-NAME
Get the history of one image that show container list built by this image
7, docker images = docker image ls
8. docker save -o and docker load -i VS docker import and docker export
save/laod a image storage file that contains history data and metadata, is more full.
import/export a image snapshoot that has part data of image. But it can change tag when importing.
9. docker top CONTAINER-NAME show the process of container
10. docker wait CONTAINER-NAME Block util one container stop and print exit code
11. docker volume create/ls/inspect/rm/prune
- $ docker volume create hello
- $ docker run -d -v hello:/world busybox ls /world
- $ docker volume prune
- $ docker volume prune --filter='label=latest'
1. docker checkpoint
docker checkpoint create / docker checkpoint ls / docker checkpoint rm
- $ docker run -d --name looper2 --security-opt seccomp:unconfined busybox \
- /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
-
- # wait a few seconds to give the container an opportunity to print a few lines, then
- $ docker checkpoint create --checkpoint-dir=/tmp looper2 checkpoint2
-
- $ docker create --name looper-clone --security-opt seccomp:unconfined busybox \
- /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
-
- $ docker start --checkpoint-dir=/tmp --checkpoint=checkpoint2 looper-clone
2.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。