Gitlab CI / Docker:使用自定义图像作业
这是我如何做一些棉绒testing(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 .
但是,每个testing都需要将软件包安装到Ubuntu镜像,这需要花费时间。
所以我想用这个来build立一个图像。 我想出了这个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
那我呢
$ docker build -t linter-testing:latest .
和这个yml文件:
linter: image: linter-testing:latest stage: test tags: - testing before_script: - meteor npm install eslint eslint-plugin-react script: - ./node_modules/.bin/eslint --ext .js --ext .jsx .
但是这个错误会失败:
ERROR: Job failed: Error response from daemon: repository linter-testing not found: does not exist or no pull access
那么为什么这个图像不存在,所以docker images
显示了我的确切形象…
你需要编辑你的runner机器上的/etc/gitlab-runner
config.toml
文件,内容如下
[runners.docker] pull_policy = "if-not-present"
这里看到相关的问题。
- 试图在windows中创build一个Docker L2Bridgenetworking,抛出一个系统找不到指定错误的文件
- 多个Docker容器和芹菜
- 无法在nanoserver中运行.exe(无符号?)应用程序
- 基于Linux的Docker镜像在Windows Server 2016 TP5上
- 如何连接elixir中的两个docker容器的节点?
- Docker:Swarm worker节点没有find本地构build的映像
- Docker客户端与Docker主机进行通信
- java应用程序在kubernetes中的应用程序configuration
- 关于Supervisor和Apache的error.log尾部的说明