一、标准化部署基础环境
[root@VM-0-12-centos ~]# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
[root@VM-0-12-centos ~]# yum update -y
➜ ~ sudo vim /etc/hosts
➜ ~ ssh-copy-id -i ~/.ssh/id_rsa.pub root@se
➜ ~ ssh root@se
二、部署docker 20.10.11环境
[root@VM-0-12-centos ~]
[root@VM-0-12-centos ~]
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo
未找到匹配的参数: docker
未找到匹配的参数: docker-common
未找到匹配的参数: docker-selinux
未找到匹配的参数: docker-engine
没有软件包需要移除。
依赖关系解决。
无需任何处理。
完毕!
[root@VM-0-12-centos ~]
[root@VM-0-12-centos ~]
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo
添加仓库自:https://download.docker.com/linux/centos/docker-ce.repo
[root@VM-0-12-centos ~]
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo
添加仓库自:http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@VM-0-12-centos ~]
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo
47 文件已删除
[root@VM-0-12-centos ~]
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo
EPEL for redhat/centos 8 - x86_64 6.4 MB/s | 11 MB 00:01
CentOS Linux 8 - AppStream 7.6 MB/s | 8.1 MB 00:01
CentOS Linux 8 - BaseOS 3.3 MB/s | 3.5 MB 00:01
CentOS Linux 8 - Extras 14 kB/s | 10 kB 00:00
Docker CE Stable - x86_64 37 kB/s | 19 kB 00:00
元数据缓存已建立。
[root@VM-0-12-centos ~]
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo
docker-ce.x86_64 3:20.10.9-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.8-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.7-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.6-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.5-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.4-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.3-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.2-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.1-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.11-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.10-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.0-3.el8 docker-ce-stable
docker-ce.x86_64 3:19.03.15-3.el8 docker-ce-stable
docker-ce.x86_64 3:19.03.14-3.el8 docker-ce-stable
docker-ce.x86_64 3:19.03.13-3.el8 docker-ce-stable
上次元数据过期检查:0:00:06 前,执行于 2021年11月18日 星期四 14时17分40秒。
可安装的软件包
[root@VM-0-12-centos ~]
[root@VM-0-12-centos ~]
[root@VM-0-12-centos ~]
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[root@VM-0-12-centos ~]
Client: Docker Engine - Community
Version: 20.10.11
Server: Docker Engine - Community
Engine:
Version: 20.10.11
[root@VM-0-12-centos ~]
三、部署docker 2.1.1环境
[root@VM-0-12-centos ~]# mkdir -p /data/source
[root@VM-0-12-centos source]# wget https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64
[root@VM-0-12-centos source]# chmod 700 docker-compose-linux-x86_64
[root@VM-0-12-centos source]# cp docker-compose-linux-x86_64 /usr/local/bin/docker-compose
[root@VM-0-12-centos ~]# cd ~/ ; pwd ; docker-compose version
/root
Docker Compose version v2.1.1
四、部署harbor 2.3.4环境
[root@VM-0-12-centos ~]# cd /data/source/ ; wget https://github.com/goharbor/harbor/releases/download/v2.3.4/harbor-offline-installer-v2.3.4.tgz
[root@VM-0-12-centos source]# tar zxvf harbor-offline-installer-v2.3.4.tgz
五、部署Nginx环境
[root@VM-0-12-centos ~]
[root@VM-0-12-centos ~]
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest ea335eea17ab 20 hours ago 141MB
[root@VM-0-12-centos ~]
[root@VM-0-12-centos ~]
[root@VM-0-12-centos data]
[root@VM-0-12-centos data]
[root@VM-0-12-centos data]
[root@VM-0-12-centos data]
user nginx
worker_processes 1
error_log /var/log/nginx/error.log warn
pid /var/run/nginx.pid
events {
worker_connections 1024
}
http {
include /etc/nginx/mime.types
default_type application/octet-stream
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
access_log /var/log/nginx/access.log main
sendfile on
keepalive_timeout 65
include /etc/nginx/conf.d/*.conf
}
[root@VM-0-12-centos conf.d]
server {
listen 80
server_name localhost
location / {
root /usr/share/nginx/html
index index.html index.htm
}
error_page 500 502 503 504 /50x.html
location = /50x.html {
root /usr/share/nginx/html
}
}
[root@VM-0-12-centos ~]# docker run -d --name nginx -p 80:80 -p 443:443 -v /data/apps/nginx/nginx.conf:/etc/nginx/nginx.conf -v /data/apps/nginx/conf.d:/etc/nginx/conf.d -v /data/apps/nginx/logs:/var/log/nginx nginx
e1bd2f55730592886b3a13d7eb7b6257ccd829bb22997d528708009d1caac439
[root@VM-0-12-centos ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e1bd2f557305 nginx "/docker-entrypoint.…" 4 seconds ago Up 3 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp nginx
- 常用工具安装mwget/axel
wget http://jaist.dl.sourceforge.net/project/kmphpfm/mwget/0.1/mwget_0.1.0.orig.tar.bz2
tar -jxvf mwget_0.1.0.orig.tar.bz2
yum install bzip2
bzip2 -d mwget_0.1.0.orig.tar.bz2
tar -jxvf mwget_0.1.0.orig.tar.bz2
yum install gcc-c++
yum install openssl-devel
yum install intltool
./configure
make
make install
[root@node2 ~]
[root@node2 ~]
[root@node2 axel-2.4]
[root@node2 axel-2.4]
[root@node2 axel-2.4]
- 包/DEV管理工具安装
[root@node2 ~]# yum install npm
npm install --global yarn
[root@node2 ~]# yarn --version
1.22.11
#[root@node2 ~]# yarn install && yarn dev