目标
开发机上0环境,全都由容器实现
开始
1) 创建一个项目目录
2)编写一个 Dockerfile 文件(区分大小写),创建一个开发环境镜像
Dockerfile
FROM node:10.19.0-stretch-slim
# system local config
RUN true \
# debian china mirrors
&& sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
# timezone to china
&& ln -sf /usr/share/zoneinfo/PRC /etc/localtime
RUN apt-get update \
&& apt-get install -y \
# node-sass 等编译依赖
make gcc g++ python \
# 命令行工具
zsh curl wget vim git
# RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
RUN sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
RUN true \
&& npm config set registry https://registry.npm.taobao.org