一、什么是 Docker
Docker 是一个开源的容器化平台,可以使开发者将应用及其依靠打包到一个容器中,而且可以在任何情况中一致地运行。容器是轻量级的、可移植的,可以实现跨平台和跨情况的部署。
Docker 与虚拟化的区别
- 虚拟化:虚拟机需要虚拟化硬件,启动时占用大量资源,启动时间较长。
- 容器化:容器通过共享操纵体系内核来创建多个隔离的运行情况,资源占用少,启动敏捷。
二、Docker 安装与卸载
1. Docker 安装
链接1: https://pan.baidu.com/s/1YSWFE1VmnD7sZvIiDZ-d8w?pwd=iszn 提取码: iszn
链接2:https://znas.cn/AppH5/share/?nid=LIYDEMJQGFBDGRBUGJBE2&code=yrCZtbYxYgm3P0Il8otysH2p2jvG5l3j5BU0S3wNVim3C4U7w7w7L5rm3tVhcl99WW8&mode=file&display=list- [root@docker:~]# ll autoinstall-docker-docker-compose.tar.gz
- -rw-r--r-- 1 root root 84288398 Feb 27 19:04 autoinstall-docker-docker-compose.tar.gz
- [root@docker:~]# ./install-docker.sh i
- [root@docker:~]# docker --version
- Docker version 20.10.24, build 297e128
复制代码 验证安装是否成功,通过运行 hello-world 镜像- [root@docker:~]# docker run crpi-z431eabbod8b9a37.cn-shenzhen.personal.cr.aliyuncs.com/jasper2024/k8s:latest
- Unable to find image 'crpi-z431eabbod8b9a37.cn-shenzhen.personal.cr.aliyuncs.com/jasper2024/k8s:latest' locally
- latest: Pulling from jasper2024/k8s
- e6590344b1a5: Pull complete
- Digest: sha256:7565f2c7034d87673c5ddc3b1b8e97f8da794c31d9aa73ed26afffa1c8194889
- Status: Downloaded newer image for crpi-z431eabbod8b9a37.cn-shenzhen.personal.cr.aliyuncs.com/jasper2024/k8s:latest
- 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 the
- executable that produces the output you are currently reading.
- 4. The Docker daemon streamed that output to the Docker client, which sent it
- to your terminal.
- To try something more ambitious, you can run an Ubuntu container with:
- $ docker run -it ubuntu bash
- Share 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/
复制代码 2. Docker 卸载
- [root@docker:~]# ./install-docker.sh r
- Removed /etc/systemd/system/multi-user.target.wants/docker.service.
- Docker 卸载成功!
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |