相关疑难解决方法(0)

Gitlab CI/Docker:使用自定义图像进行工作

这就是我做一些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)

gitlab docker gitlab-ci dockerfile

10
推荐指数
1
解决办法
3882
查看次数

标签 统计

docker ×1

dockerfile ×1

gitlab ×1

gitlab-ci ×1