欢迎光临
我们一直在努力
RackNerd Billboard Banner

Ubuntu 22.04 LTS 部署docker

Linux服务器运维

一、什么是 Docker

Docker 是一个开源的容器化平台,可以使开发者将应用及其依赖打包到一个容器中,并且可以在任何环境中一致地运行。容器是轻量级的、可移植的,可以实现跨平台和跨环境的部署。

Docker 与虚拟化的区别

  • 虚拟化:虚拟机需要虚拟化硬件,启动时占用大量资源,启动时间较长。
  • 容器化:容器通过共享操作系统内核来创建多个隔离的运行环境,资源占用少,启动迅速。

二、Docker 安装与卸载

1. Docker 安装

链接1: 提取码: iszn
链接2:

[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 卸载成功!
赞(0) 打赏
未经允许不得转载:全球主机测评 » Ubuntu 22.04 LTS 部署docker
RackNerd Leaderboard Banner 新春特惠 服务器运维包年大优惠查看活动

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫