title: 给前端的Docker-Node环境实践
tags:
- 前端
- Docker
- Node.js
- MongoDB
- Nginx
categories: - 前端
date: 2020-01-29 12:25:00
服务器准备
Linux
版本:Centos 7.6
Docker安装
清理Docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
安装依赖
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
- 设置
yum
源:sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- 更新缓存:
sudo yum makecache fast
- 安装
Docker-ce
[1]:sudo yum -y install docker-ce
- 启动
Docker
:sudo systemctl start docker
- 测试命令:
docker -v
Docker-Compose [2]
- 安装docker-compose
curl -L https://get.daocloud.io/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- 验证
docker-compose -v