这就是我做一些linter测试(eslint)的方法.
linter:
image: ubuntu:16.04
stage: test
tags:
- testing
before_script:
- apt-get update -y
- apt-get install nodejs-legacy -yqq
- apt-get install curl -yqq
- curl https://install.meteor.com/ | sh
- meteor npm install eslint eslint-plugin-react
script:
- ./node_modules/.bin/eslint --ext .js --ext .jsx .
Run Code Online (Sandbox Code Playgroud)
但有了这个,每个测试都必须将软件包安装到ubuntu映像,这需要时间.
所以我想用这个来构建一个图像.我想出了这个Dockerfile:
FROM ubuntu:16.04
RUN apt-get update -y
RUN apt-get install nodejs-legacy -yqq
RUN apt-get install curl -yqq
RUN apt-get clean && apt-get autoclean && apt-get autoremove
RUN curl https://install.meteor.com/ | sh
Run Code Online (Sandbox Code Playgroud)
然后我做
$ docker build -t …Run Code Online (Sandbox Code Playgroud)