写在前面
本文看下学习k8s需要的基础环境,包括运行环境,docker等。
1:准备linux运行环境
环境:win10
虚拟化工具:VMware-workstation-full-15.1.0
linux:ubuntu-22.04.1-desktop-amd64.iso 。
安装完毕后我们开始准备其它环境。
2:安装docker环境
安装:
sudo apt install docker.io
安装后验证:
dongyunqi@dongyunqi-virtual-machine:/etc/docker$ docker version
Client:
Version: 20.10.12
...
镜像下载加速:
dongyunqi@dongyunqi-virtual-machine:/etc/docker$ sudo touch daemon.json
[sudo] password for dongyunqi:
dongyunqi@dongyunqi-virtual-machine:/etc/docker$ sudo tee /etc/docker/daemon.json <<-'EOF'
> {
> "registry-mirrors": ["https://8csof3cn.mirror.aliyuncs.com"]
> }
> EOF
{
"registry-mirrors": ["https://8csof3cn.mirror.aliyuncs.com"]
}
3:运行镜像
Last login: Sat Dec 31 15:15:57 2022 from 192.168.64.1
dongyunqi@dongyunqi-virtual-machine:~$ docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:c77be1d3a47d0caf71a82dd893ee61ce01f32fc758031a6ec4cf1389248bb833
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
dongyunqi@dongyunqi-virtual-machine:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest feb5d9fea6a5 15 months ago 13.3kB
dongyunqi@dongyunqi-virtual-machine:~$ 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 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/
上面运行hello-world
的输出说明其实就是docker的工作过程和原理,如下图:
写在后面
参考文章列表:
Docker 镜像加速
清华大学开源软件镜像站 。
sftp的基本使用 。
VMware Workstation Pro 15 for Windows下载与安装 。
高速下载Ubuntu系统【清华大学开源软件镜像站】(ubuntu-22.04.1-desktop-amd64.iso) 。