CentOS+Docker+安装
Last updated
2023-01-18 17:51:48
{"value":"### \u524d\u63d0\u6761\u4ef6\n\n\u76ee\u524d\uff0cCentOS \u4ec5\u53d1\u884c\u7248\u672c\u4e2d\u7684\u5185\u6838\u652f\u6301 Docker\u3002\nDocker \u8fd0\u884c\u5728 CentOS 7 \u4e0a\uff0c\u8981\u6c42\u7cfb\u7edf\u4e3a64\u4f4d\u3001\u7cfb\u7edf\u5185\u6838\u7248\u672c\u4e3a 3.10 \u4ee5\u4e0a\u3002\nDocker \u8fd0\u884c\u5728\u00a0CentOS-6.5\u00a0\u6216\u66f4\u9ad8\u7684\u7248\u672c\u7684 CentOS \u4e0a\uff0c\u8981\u6c42\u7cfb\u7edf\u4e3a64\u4f4d\u3001\u7cfb\u7edf\u5185\u6838\u7248\u672c\u4e3a 2.6.32-431 \u6216\u8005\u66f4\u9ad8\u7248\u672c\u3002\n\n### 1.\u4f7f\u7528 yum \u5b89\u88c5\uff08CentOS 7\u4e0b\uff09\n\nDocker \u8981\u6c42 CentOS \u7cfb\u7edf\u7684\u5185\u6838\u7248\u672c\u9ad8\u4e8e 3.10 \uff0c\u67e5\u770b\u672c\u9875\u9762\u7684\u524d\u63d0\u6761\u4ef6\u6765\u9a8c\u8bc1\u4f60\u7684CentOS \u7248\u672c\u662f\u5426\u652f\u6301 Docker \u3002\n\u901a\u8fc7\u00a0uname -r\u00a0\u547d\u4ee4\u67e5\u770b\u4f60\u5f53\u524d\u7684\u5185\u6838\u7248\u672c\n \n\n [root@CDNCloud ~]# uname -r\n 3.10.0-957.el7.x86_64\n\n#### \u5b89\u88c5 Docker\n\nDocker \u8f6f\u4ef6\u5305\u548c\u4f9d\u8d56\u5305\u5df2\u7ecf\u5305\u542b\u5728\u9ed8\u8ba4\u7684 CentOS-Extras \u8f6f\u4ef6\u6e90\u91cc\uff0c\u5b89\u88c5\u547d\u4ee4\u5982\u4e0b\uff1a\n\n [root@CDNCloud ~]# yum -y install docker\n\n#### \u542f\u52a8 Docker \u540e\u53f0\u670d\u52a1\n\n\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u542f\u52a8 Docker \u540e\u53f0\u670d\u52a1\n\n [root@CDNCloud ~]# service docker start\n\n#### \u6d4b\u8bd5\u8fd0\u884c\n\n\u6d4b\u8bd5\u8fd0\u884c hello-world\n\n[root@CDNCloud ~]# docker run hello-world\n\n##### \u4e0b\u8f7d\u955c\u50cf\u5e76\u8fd0\u884c\n\n\u7531\u4e8e\u672c\u5730\u6ca1\u6709hello-world\u8fd9\u4e2a\u955c\u50cf\uff0c\u6240\u4ee5\u4f1a\u4e0b\u8f7d\u4e00\u4e2ahello-world\u7684\u955c\u50cf\uff0c\u5e76\u5728\u5bb9\u5668\u5185\u8fd0\u884c\u3002\n\n Unable to find image 'hello-world:latest' locally\n Trying to pull repository docker.io\/library\/hello-world ... \n latest: Pulling from docker.io\/library\/hello-world\n 2db29710123e: Pull complete \n Digest: sha256:94ebc7edf3401f299cd3376a1669bc0a49aef92d6d2669005f9bc5ef028dc333\n Status: Downloaded newer image for docker.io\/hello-world:latest\n \n Hello from Docker!\n This message shows that your installation appears to be working correctly.\n \n To generate this message, Docker took the following steps:\n 1. The Docker client contacted the Docker daemon.\n 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\n (amd64)\n 3. The Docker daemon created a new container from that image which runs the\n executable that produces the output you are currently reading.\n 4. The Docker daemon streamed that output to the Docker client, which sent it\n to your terminal.\n \n To try something more ambitious, you can run an Ubuntu container with:\n $ docker run -it ubuntu bash\n \n Share images, automate workflows, and more with a free Docker ID:\n https:\/\/hub.docker.com\/\n \n For more examples and ideas, visit:\n https:\/\/docs.docker.com\/get-started\/\n\n#### \u67e5\u770bdocker\u7248\u672c\u547d\u4ee4\n\n docker -v\n\n\u5176\u4ed6docker\u547d\u4ee4\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u547d\u4ee4\u6839\u636e\u9700\u6c42\u9009\u62e9\u67e5\u770b\n\n docker -help\n\n"}