Ubuntu 22.04 LTS 部署docker
一、什么是 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 卸载成功!
分类:
docker
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架