{"id":104,"date":"2021-05-21T12:35:00","date_gmt":"2021-05-21T12:35:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=104"},"modified":"2021-05-21T12:35:00","modified_gmt":"2021-05-21T12:35:00","slug":"104","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/05\/21\/104\/","title":{"rendered":"Docker \u57fa\u7840\u547d\u4ee4\u5b66\u4e60"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/05\/3351771764.jpg\" alt=\"\" title=\"\"><\/p>\n<h3>Docker \u4e00\u952e\u5b89\u88c5\u547d\u4ee4<\/h3>\n<pre><code>curl -fsSLo- get.docker.com | \/bin\/sh<\/code><\/pre>\n<h3>\u56fd\u5185\u4f7f\u7528\u963f\u91cc\u4e91\u955c\u50cf<\/h3>\n<pre><code>wget get.docker.com -O get.docker.sh\nbash  get.docker.sh  --mirror Aliyun<\/code><\/pre>\n<h1>Docker \u57fa\u7840\u547d\u4ee4\u5b66\u4e60<\/h1>\n<pre><code># \u8fd0\u884c hello-world \u68c0\u67e5Docker\u5f15\u64ce\u662f\u5426\u5b89\u88c5\ndocker run hello-world\n\nUnable to find image 'hello-world:latest' locally\nlatest: Pulling from library\/hello-world\nb8dfde127a29: Pull complete\nDigest: sha256:5122f6204b6a3596e048758cabba3c46b1c937a46b5be6225b835d091b90e46c\nStatus: Downloaded newer image for hello-world:latest\n\nHello from Docker!\nThis message shows that your installation appears to be working correctly.\n\nTo try something more ambitious, you can run an Ubuntu container with:\n$ docker run -it ubuntu bash\n\n# \u8fd0\u884c\u4e00\u4e2a Ubuntu \u5bb9\u5668\ndocker run -it ubuntu bash\n\n# \u663e\u793a\u6240\u6709\u7684\u5bb9\u5668\ndocker ps -a\n\n# \u663e\u793a\u672c\u673a\u955c\u50cf\ndocker images\n\nCONTAINER ID   IMAGE         COMMAND    CREATED         STATUS                     PORTS     NAMES\n841f77ef8a1f   hello-world   \"\/hello\"   5 seconds ago   Exited (0) 4 seconds ago             crazy_feynman\n\n# \u67e5\u770bUbuntu\u955c\u50cf\u7684\u5386\u53f2\ndocker history hello-world\n\nIMAGE          CREATED        CREATED BY                                      SIZE      COMMENT\nd1165f221234   2 months ago   \/bin\/sh -c #(nop)  CMD [\"\/hello\"]               0B\n&lt;missing&gt;      2 months ago   \/bin\/sh -c #(nop) COPY file:7bf12aab75c3867a\u2026   13.3kB\n\n# \u67e5\u770b\u955c\u50cf\u7684\u5386\u53f2\ndocker history ubuntu\n\n#  \u5220\u9664\u6240\u6709\u5bb9\u5668\ndocker rm  -f  $(docker ps -qa)\n\n#  \u5220\u9664\u6240\u6709\u955c\u50cf\ndocker rmi -f  $(docker images -qa)\n\nUntagged: hello-world:latest\nUntagged: hello-world@sha256:5122f6204b6a3596e048758cabba3c46b1c937a46b5be6225b835d091b90e46c\nDeleted: sha256:d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726\nDeleted: sha256:f22b99068db93900abe17f7f5e09ec775c2826ecfe9db961fea68293744144bd\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/05\/386690786.jpg\" alt=\"\" title=\"\"><\/p>\n<pre><code>docker -help\nFlag shorthand -h has been deprecated, please use --help\nunknown shorthand flag: 'e' in -elp\nSee 'docker --help'.\n\nUsage:  docker [OPTIONS] COMMAND\n\nA self-sufficient runtime for containers\n\nOptions:\n      --config string      Location of client config files (default \"\/root\/.docker\")\n  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and\n                           default context set with \"docker context use\")\n  -D, --debug              Enable debug mode\n  -H, --host list          Daemon socket(s) to connect to\n  -l, --log-level string   Set the logging level (\"debug\"|\"info\"|\"warn\"|\"error\"|\"fatal\") (default \"info\")\n      --tls                Use TLS; implied by --tlsverify\n      --tlscacert string   Trust certs signed only by this CA (default \"\/root\/.docker\/ca.pem\")\n      --tlscert string     Path to TLS certificate file (default \"\/root\/.docker\/cert.pem\")\n      --tlskey string      Path to TLS key file (default \"\/root\/.docker\/key.pem\")\n      --tlsverify          Use TLS and verify the remote\n  -v, --version            Print version information and quit\n\nManagement Commands:\n  app*        Docker App (Docker Inc., v0.9.1-beta3)\n  builder     Manage builds\n  buildx*     Build with BuildKit (Docker Inc., v0.5.1-docker)\n  config      Manage Docker configs\n  container   Manage containers\n  context     Manage contexts\n  image       Manage images\n  manifest    Manage Docker image manifests and manifest lists\n  network     Manage networks\n  node        Manage Swarm nodes\n  plugin      Manage plugins\n  scan*       Docker Scan (Docker Inc.)\n  secret      Manage Docker secrets\n  service     Manage services\n  stack       Manage Docker stacks\n  swarm       Manage Swarm\n  system      Manage Docker\n  trust       Manage trust on Docker images\n  volume      Manage volumes\n\nCommands:\n  attach      Attach local standard input, output, and error streams to a running container\n  build       Build an image from a Dockerfile\n  commit      Create a new image from a container's changes\n  cp          Copy files\/folders between a container and the local filesystem\n  create      Create a new container\n  diff        Inspect changes to files or directories on a container's filesystem\n  events      Get real time events from the server\n  exec        Run a command in a running container\n  export      Export a container's filesystem as a tar archive\n  history     Show the history of an image\n  images      List images\n  import      Import the contents from a tarball to create a filesystem image\n  info        Display system-wide information\n  inspect     Return low-level information on Docker objects\n  kill        Kill one or more running containers\n  load        Load an image from a tar archive or STDIN\n  login       Log in to a Docker registry\n  logout      Log out from a Docker registry\n  logs        Fetch the logs of a container\n  pause       Pause all processes within one or more containers\n  port        List port mappings or a specific mapping for the container\n  ps          List containers\n  pull        Pull an image or a repository from a registry\n  push        Push an image or a repository to a registry\n  rename      Rename a container\n  restart     Restart one or more containers\n  rm          Remove one or more containers\n  rmi         Remove one or more images\n  run         Run a command in a new container\n  save        Save one or more images to a tar archive (streamed to STDOUT by default)\n  search      Search the Docker Hub for images\n  start       Start one or more stopped containers\n  stats       Display a live stream of container(s) resource usage statistics\n  stop        Stop one or more running containers\n  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE\n  top         Display the running processes of a container\n  unpause     Unpause all processes within one or more containers\n  update      Update configuration of one or more containers\n  version     Show the Docker version information\n  wait        Block until one or more containers stop, then print their exit codes\n<\/code><\/pre>\n<h2>\u5378\u8f7dDocker Engine\uff0cCLI\u548cContainerd\u8f6f\u4ef6\u5305<\/h2>\n<pre><code>apt-get purge docker-ce docker-ce-cli containerd.io\n<\/code><\/pre>\n<ul>\n<li>\u4e3b\u673a\u4e0a\u7684\u6620\u50cf\uff0c\u5bb9\u5668\uff0c\u5377\u6216\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u4e0d\u4f1a\u81ea\u52a8\u5220\u9664\u3002\u8981\u5220\u9664\u6240\u6709\u56fe\u50cf\uff0c\u5bb9\u5668\u548c\u5377\uff1a<\/li>\n<\/ul>\n<pre><code>rm -rf \/var\/lib\/docker\nrm -rf \/var\/lib\/containerd<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/05\/134507574.jpg\" alt=\"\" title=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker \u4e00\u952e\u5b89\u88c5\u547d\u4ee4 curl -fsSLo- get.docker.com | \/bin\/s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[15],"class_list":["post-104","post","type-post","status-publish","format-standard","hentry","category-docker","category-default","tag-docker"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}