docker虚拟化容器技术
生活随笔
收集整理的這篇文章主要介紹了
docker虚拟化容器技术
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
docker虛擬化容器技術
- 1、安裝
- 2、查看docker服務
- 3、卸載
- 4、幫助命令
- 5、鏡像命令
1、安裝
#安裝方式一 curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun#安裝方法二 sudo apt remove docker docker-engine docker.io containerd runc sudo apt update sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release sudo apt install docker-ce docker-ce-cli containerd.iosudo snap install docker # version 20.10.8, or sudo apt install docker.io # version 20.10.7-0ubuntu1~20.04.22、查看docker服務
$ docker --version $ docker version $ sudo systemctl status docker $ sudo service docker status restart stop enable disable3、卸載
sudo apt remove docker docker-engine docker.io containerd runc sudo apt autoremove docker-ce-* sudo rm -rf /etc/systemd/system/docker.service.d sudo rm -rf /var/lib/docker或者
sudo systemctl disable docker /lib/systemd/systemd-sysv-install disable docker sudo find / -name docker.service | xargs sudo rm -rf sudo find / -name docker.service sudo rm /etc/init.d/docker sudo systemctl daemon-reloadsudo service docker status或者
webrx@us:/etc/init.d$ sudo systemctl daemon-reload webrx@us:/etc/init.d$ sudo rm /etc/init.d/docker webrx@us:/etc/init.d$ sudo systemctl daemon-reload webrx@us:/etc/init.d$ sudo systemctl status docker Unit docker.service could not be found. webrx@us:/etc/init.d$ sudo service docker status Unit docker.service could not be found. webrx@us:/etc/init.d$4、幫助命令
$ docker version $ docker --version $ info $ docker 命令 --help $ docker pull --help $ docker 回車查看所有命令信息5、鏡像命令
#1 查看本地鏡像,沒有鏡像 webrx@us:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE#2 從官方hub.docker.com接取一個hello-world鏡像案例 webrx@us:~$ docker pull hello-world Using default tag: latest latest: Pulling from library/hello-world 2db29710123e: Pull complete Digest: sha256:37a0b92b08d4919615c3ee023f7ddb068d12b8387475d64c622ac30f45c29c51 Status: Downloaded newer image for hello-world:latest docker.io/library/hello-world:latest#3 再查看鏡像 docker images docker images -q docker images -aqwebrx@us:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest feb5d9fea6a5 4 weeks ago 13.3kB#4 運行hello-world鏡像 webrx@us:~$ docker run hello-world#運行結果 Hello from Docker! This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64)3. The Docker daemon created a new container from that image which runs theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:https://hub.docker.com/For more examples and ideas, visit:https://docs.docker.com/get-started/#5 搜索鏡像 docker search mysql docker search webrxdocker search --limit 35 --no-trunc centosdocker pull mysql 拉取NAME: 鏡像倉庫源的名稱DESCRIPTION: 鏡像的描述OFFICAL: 是否docker官方發布stars: 類似Github里面的star,表示點贊、喜歡的意思AUTOMATED: 自動構建#6 刪除鏡像 docker rmi -f 鏡像ID總結
以上是生活随笔為你收集整理的docker虚拟化容器技术的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: javascript的基本概念
- 下一篇: 初夏养生宜清热利湿