2020 Docker Centos安装

2020 Docker Centos安装

Centos 7及其以上 Linux Docker安装

更新系统

yum update -y

安装docker

sudo yum install -y yum-utils  device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo  https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce -y
sudo systemctl enable docker
sudo systemctl start docker

docker 加速器配置

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://1z4fonv9.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

安装pip

sudo yum install python-pip 
sudo pip install --upgrade pip

安装 docker-compose

pip install docker-compose -i https://mirrors.aliyun.com/pypi/simple/

安装 node

yum install -y wget
cd opt
wget https://npm.taobao.org/mirrors/node/v14.5.0/node-v14.5.0-linux-x64.tar.xz
tar -xvf node-v14.5.0-linux-x64.tar.xz
mv node-v14.5.0-linux-x64 nodejs
ln -s /opt/nodejs/nodejs/bin/npm /usr/local/bin/
ln -s /opt/nodejs/nodejs/bin/node /usr/local/bin/
vi /etc/profile

在最下方添加,然后保存:wq

export NODE_HOME=/opt/nodejs
export PATH=$NODE_HOME/bin:$PATH

然后生效环境

source /etc/profile

安装 git

yum install -y git
本文总阅读量0
本站总访问量 本站访客数人次