当前位置:   article > 正文

Docker overview_docker start --checkpoint looper2 looper2

docker start --checkpoint looper2 looper2

Base command:

1. docker create [OPTIONS] IMAGE [COMMAND] [ARG...]     create one container.

  1. $ docker create --name looper busybox /bin/sh -c 'sleep 10 && echo 1234'
  2. $ docker start looper

2. docker stats      show containers' usage statistic like linux command top

  1. $ docker stats
  2. $ docker container stats
  3. $ docker stats CONTAINER-NAME
  4. $ 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

  1. docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
  2. 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

  1. $ docker volume create hello
  2. $ docker run -d -v hello:/world busybox ls /world
  3. $ docker volume prune
  4. $ docker volume prune --filter='label=latest'

 

 

Interesting command(most of them is experimental):

1. docker checkpoint 

    docker checkpoint create / docker checkpoint ls / docker checkpoint rm

  1. $ docker run -d --name looper2 --security-opt seccomp:unconfined busybox \
  2. /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
  3. # wait a few seconds to give the container an opportunity to print a few lines, then
  4. $ docker checkpoint create --checkpoint-dir=/tmp looper2 checkpoint2
  5. $ docker create --name looper-clone --security-opt seccomp:unconfined busybox \
  6. /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
  7. $ docker start --checkpoint-dir=/tmp --checkpoint=checkpoint2 looper-clone

2. 

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号