不想写代码,找了一个不写代码的,看评价说Appsmith最好,那就试试它。
可是为了搭建Appsmithe,还需要先安装docker。
以为低代码省事,没想到比写代码还费事,但愿后面省事,开干。
第一步:安装Centos
`1.在阿里云的镜像站点下载 centos stream
https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/iso/?spm=a2c6h.25603864.0.0.7af9460d3WArE9
2.搞了一台虚拟机安装centos
3.登录centos设置账户密码
4.关闭和禁用防火墙
5.yum包更新到最新。
$ sudo yum update
第二步:安装Docker
https://docs.docker.com/engine/install/centos/ ,一看文档安装方式,怎么和网上找到的文章不一样,定睛细看,原版里面写了三种安装方法,大部分文章里面使用了它介绍的第三种方法,我还是按原版的推荐方法来:
方式一:Install using the rpm repository
1.Set up the repository
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
[root@localhost ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
[root@localhost ~]# sudo yum install -y yum-utils
Last metadata expiration check: 0:14:30 ago on Sun 14 Jan 2024 01:55:09 AM EST.
Dependencies resolved.
===========================================================================================================
Package Architecture Version Repository Size
===========================================================================================================
Installing:
yum-utils noarch 4.3.0-12.el9 baseos 41 k
Transaction Summary
===========================================================================================================
Install 1 Package
Total download size: 41 k
Installed size: 23 k
Downloading Packages:
yum-utils-4.3.0-12.el9.noarch.rpm 779 kB/s | 41 kB 00:00
-----------------------------------------------------------------------------------------------------------
Total 40 kB/s | 41 kB 00:01
CentOS Stream 9 - BaseOS 1.6 MB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key)
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : yum-utils-4.3.0-12.el9.noarch 1/1
Running scriptlet: yum-utils-4.3.0-12.el9.noarch 1/1
Verifying : yum-utils-4.3.0-12.el9.noarch 1/1
Installed:
yum-utils-4.3.0-12.el9.noarch
Complete!
2.Install Docker Engine
2.1 sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
[root@localhost ~]#yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Docker CE Stable - x86_64 3.1 kB/s | 33 kB 00:10
Last metadata expiration check: 0:00:03 ago on Sun 14 Jan 2024 02:10:25 AM EST.
Dependencies resolved.
===========================================================================================================
Package Architecture Version Repository Size
===========================================================================================================
Installing:
containerd.io x86_64 1.6.26-3.1.el9 docker-ce-stable 34 M
docker-buildx-plugin x86_64 0.11.2-1.el9 docker-ce-stable 13 M
docker-ce x86_64 3:24.0.7-1.el9 docker-ce-stable 24 M
docker-ce-cli x86_64 1:24.0.7-1.el9 docker-ce-stable 7.1 M
docker-compose-plugin x86_64 2.21.0-1.el9 docker-ce-stable 13 M
Installing weak dependencies:
docker-ce-rootless-extras x86_64 24.0.7-1.el9 docker-ce-stable 3.9 M
Transaction Summary
===========================================================================================================
Install 6 Packages
Total download size: 94 M
Installed size: 369 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): containerd.io-1.6.26-3.1.el9.x86_64.rpm 4.3 MB/s | 34 MB 00:07
(2/6): docker-ce-cli-24.0.7-1.el9.x86_64.rpm 3.7 MB/s | 7.1 MB 00:01
(3/6): docker-ce-rootless-extras-24.0.7-1.el9.x86_64.rpm 6.0 MB/s | 3.9 MB 00:00
(4/6): docker-compose-plugin-2.21.0-1.el9.x86_64.rpm 4.2 MB/s | 13 MB 00:03
[MIRROR] docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm: Curl error (28): Timeout was reached for https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
[MIRROR] docker-ce-24.0.7-1.el9.x86_64.rpm: Curl error (28): Timeout was reached for https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-ce-24.0.7-1.el9.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
[MIRROR] docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm: Curl error (28): Timeout was reached for https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
[MIRROR] docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm: Curl error (28): Timeout was reached for https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
[FAILED] docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
(6/6): docker-ce-24.0.7-1.el9.x86_ 75% [========================- ] 2.6 MB/s | 71 MB 00:08 ETA
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: Error downloading packages:
docker-buildx-plugin-0.11.2-1.el9.x86_64: Cannot download, all mirrors were already tried without success
[root@localhost ~]#
这里肯定不成功,试了很多次都是这个结果,卡住了,网络不给力!
2.2改成阿里云的镜像
[root@localhost ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
此时查看 /etc/yum.repos.d/docker-ce.repo,里面应该都变成了阿里云的镜像站点
2.3再次安装
root@localhost ~]#yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
===========================================================================================================
Package Architecture Version Repository Size
===========================================================================================================
Installing:
containerd.io x86_64 1.6.26-3.1.el9 docker-ce-stable 34 M
docker-buildx-plugin x86_64 0.11.2-1.el9 docker-ce-stable 13 M
docker-ce x86_64 3:24.0.7-1.el9 docker-ce-stable 24 M
docker-ce-cli x86_64 1:24.0.7-1.el9 docker-ce-stable 7.1 M
docker-compose-plugin x86_64 2.21.0-1.el9 docker-ce-stable 13 M
Installing weak dependencies:
docker-ce-rootless-extras x86_64 24.0.7-1.el9 docker-ce-stable 3.9 M
Transaction Summary
===========================================================================================================
Install 6 Packages
Total download size: 94 M
Installed size: 369 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): docker-buildx-plugin-0.11.2-1.el9.x86_64.rpm 427 kB/s | 13 MB 00:30
(2/6): docker-ce-cli-24.0.7-1.el9.x86_64.rpm 456 kB/s | 7.1 MB 00:16
(3/6): docker-ce-rootless-extras-24.0.7-1.el9.x86_64.rpm 454 kB/s | 3.9 MB 00:08
(4/6): containerd.io-1.6.26-3.1.el9.x86_64.rpm 429 kB/s | 34 MB 01:20
(5/6): docker-compose-plugin-2.21.0-1.el9.x86_64.rpm 411 kB/s | 13 MB 00:31
(6/6): docker-ce-24.0.7-1.el9.x86_64.rpm 228 kB/s | 24 MB 01:46
-----------------------------------------------------------------------------------------------------------
Total 901 kB/s | 94 MB 01:46
Docker CE Stable - x86_64 8.2 kB/s | 1.6 kB 00:00
Importing GPG key 0x621E9F35:
Userid : "Docker Release (CE rpm)
Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
From : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : docker-compose-plugin-2.21.0-1.el9.x86_64 1/6
Running scriptlet: docker-compose-plugin-2.21.0-1.el9.x86_64 1/6
Installing : docker-buildx-plugin-0.11.2-1.el9.x86_64 2/6
Running scriptlet: docker-buildx-plugin-0.11.2-1.el9.x86_64 2/6
Installing : docker-ce-cli-1:24.0.7-1.el9.x86_64 3/6
Running scriptlet: docker-ce-cli-1:24.0.7-1.el9.x86_64 3/6
Installing : containerd.io-1.6.26-3.1.el9.x86_64 4/6
Running scriptlet: containerd.io-1.6.26-3.1.el9.x86_64 4/6
Installing : docker-ce-rootless-extras-24.0.7-1.el9.x86_64 5/6
Running scriptlet: docker-ce-rootless-extras-24.0.7-1.el9.x86_64 5/6
Installing : docker-ce-3:24.0.7-1.el9.x86_64 6/6
Running scriptlet: docker-ce-3:24.0.7-1.el9.x86_64 6/6
Verifying : containerd.io-1.6.26-3.1.el9.x86_64 1/6
Verifying : docker-buildx-plugin-0.11.2-1.el9.x86_64 2/6
Verifying : docker-ce-3:24.0.7-1.el9.x86_64 3/6
Verifying : docker-ce-cli-1:24.0.7-1.el9.x86_64 4/6
Verifying : docker-ce-rootless-extras-24.0.7-1.el9.x86_64 5/6
Verifying : docker-compose-plugin-2.21.0-1.el9.x86_64 6/6
Installed:
containerd.io-1.6.26-3.1.el9.x86_64 docker-buildx-plugin-0.11.2-1.el9.x86_64
docker-ce-3:24.0.7-1.el9.x86_64 docker-ce-cli-1:24.0.7-1.el9.x86_64
docker-ce-rootless-extras-24.0.7-1.el9.x86_64 docker-compose-plugin-2.21.0-1.el9.x86_64
Complete!
安装成功!
2.4 官网还有其他两种方式:
方式二:Install using the rpm repository,离线方式安装,我联网的就不折腾了。
方式三:Install using the convenience script,不推荐应用于生产环境,适用于测试环境
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
执行这个脚本会添加 docker.repo 源并安装 Docker。
我都安装成功了,懒得折腾方式三了。
3.启动docker
[root@localhost ~]# systemctl start docker
4.测试Docker,让它拉取一个镜像
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:4bd78111b6914a99dbc560e6a20eab57ff6655aea4a80c50b0c5491968cbc2e6
Status: Downloaded newer image for hello-world: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/
成功!
[root@localhost ~]# docker --version
Docker version 24.0.7, build afdd53b
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d2c94e258dcb 8 months ago 13.3kB