Tag: gitlab ci

使用docker执行程序的gitlab-runner无法上传文物

我有问题在我的构build产生文物。 我的设置是一台服务器,安装了Gitlab,同一台服务器安装并configuration了运行程序。 Gitlab v9.5.1 Gitlab Runner v9.5.0 鉴于这个gitlab-ci.yaml image: node:6 before_script: – npm install cache: untracked: true key: '$CI_BUILD_REF_NAME' paths: – node_modules/ stages: – test – build testJob: stage: test script: – npm test buildJob: stage: build when: manual artifacts: paths: – dist/ script: – npm run build 并configuration使用docker执行器的运行。 除了处理工件之外,所有东西都是按照它应该build立的。 手动执行buildJob时,我得到以下输出 Uploading artifacts… dist/: found […]

在.gitlab-ci.yml中找不到curl命令

我有一个.gitlab-ci.yml文件。 它创build了一些docker图像,并推送到AWS ECR。 当我运行curl命令将一些工件推送到远程仓库时,它说curl:找不到。 我已经使用openjdk图像来做./gradlew构build。 不知道如何在Gitlab runner上安装curl。 请指导。

如何使用官方的docker镜像作为GitLab CI中的服务?

环境: GitLab社区版9.5.2 描述: 我使用node:8.4.0是我的主要形象。 它会在其他工作中做一些Node.js程序,我会在下面忽略它们。 这是我的.gitlab-ci.yml : image: node:8.4.0 services: – docker:latest stages: – docker_build docker_build_job: stage: docker_build script: – sudo docker build -t my_name/repo_name . – sudo docker images 问题: 我不能在GitLab运行器中使用docker命令,并获取下面的消息: Running with gitlab-ci-multi-runner 9.5.0 (413da38) on ci server running on a VM of PEM5208 (5a0ceca0) Using Docker executor with image node:8.4.0 … Starting […]

自动validation私人dockerregistry

我有一个GitLab托pipe的私人dockerregistry。 我需要支持自动访问这个registry(通过Gitlab CI),但我不想使用开发人员凭据(不安全,并且需要每次开发人员离开公司时更改它们)。 别人怎么authentication? 你是否创build了一个“API帐户”进行身份validation? Docker似乎不支持服务帐号密钥或其他validation方法。 谢谢 编辑: GitLab CI SSHregistrylogin 这里接受的答案回答了GitLab的问题。 不过,我想知道是否有其他select,因为这仍然只允许通过GitLab CI进行部署时的临时密钥

webpack CLI – / usr / bin / env:node:没有这样的文件或目录

我使用一个webpack,它有这个shebang它的cli文件#! /usr/bin/env node #! /usr/bin/env node ,并假设使用它的CI运行器和docker镜像在gitlab上运行。 https://github.com/webpack/webpack/blob/master/bin/webpack.js 无论我使用哪个节点图像,都会返回此错误: /usr/bin/env: node : No such file or directory npm info lifecycle @1.0.0~prod: Failed to exec prod script npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the @1.0.0 prod […]

Docker在GitLab CI runner容器中不可用

我正在尝试使用由digitallumberjack提供的GitLab CI runner,因为它提供了从容器内部使用Docker命令的支持。 GitLab CI亚军脚本: docker run –name gitlab-ci-multi-runner -d –restart=always \ –volume /var/run/docker.sock:/var/run/docker.sock \ –volume /mnt/data/gitlab/gitlab-runner:/home/gitlab_ci_multi_runner/data \ –env='CI_SERVER_URL=https://gitlab.dev.abc.net/ci' –env='RUNNER_TOKEN=RijUZPnMjGeNF2JYt' \ –env='RUNNER_DESCRIPTION=runnerA' –env='RUNNER_EXECUTOR=docker' \ –env='RUNNER_DOCKER_IMAGE=docker:17.07.0-ce' –env='RUNNER_DOCKER_MODE=socket' \ –link gitlab.dev.abc.net \ digitallumberjack/docker-gitlab-ci-multi-runner:v9.3.0-1 .gitlab-ci.yml内容: image: node:6.11 types: – build – deploy build_app: type: build script: "bash chmod +x ./configure_proxy_artifactory.sh" script: "bash ./configure_proxy_artifactory.sh" 但是,当GitLab CI构build运行时,我在运行日志中出现以下错误: ./configure_proxy_artifactory.sh: line 13: […]

什么是gitlab $ CI_JOB_TOKEN的生命周期

鉴于此login: docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.example.com 什么是login的生命周期? 特别用于kubernetes部署。 kubernetes是否需要为其创build的实际gitlab用户重新启动节点并重新提取图像?

docker机+ Gitlabregistry – 如何使authentication工作?

我试图在docker机器主机上构build一个Docker镜像,并将镜像推送到Gitlabregistry中。 我启用了registry,然后按照这里所描述的使用docker-machine(除了我使用172.17.0.1作为主机IP,但是它在Gitlab Runnerconfiguration中的一个小的改变之后)。 问题是,build立图像后,当我试图推它,我得到以下错误: $ docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab.organization.com:39140 Login Succeeded $ docker build -t gitlab.organization.com:39140/organization/project-name . (build went fine) $ docker push gitlab.organization.com:39140/organization/project-name The push refers to a repository [gitlab.organization.com:39140/organization/project-name] 9da290505e25: Preparing 4edf62705ffc: Preparing 9845b0e669c4: Preparing 0dd280e9ab09: Preparing 1efea06cfe5b: Preparing cf516324493c: Preparing cf516324493c: Waiting denied: access forbidden ERROR: Job failed: exit […]

如何在同一个Unix主机上运行shell和docker执行程序?

我想使用相同的主机来执行使用shell执行程序的Docker构build,如下面的链接所述,以及使用docker执行程序的常规构build。 我希望能够在同一主机上启动两种types的构build。 我想使用Ubuntu提供的debian软件包,并通过存储库中的ant进行安装。 https://docs.gitlab.com/ce/ci/docker/using_docker_build.html 换句话说,如果我运行一个项目来构builddocker容器,那么shell执行器应该对docker运行命令。 如果我构build了一个源代码项目,docker executor应该在Docker容器中运行我的构build。 有人可以请描述实现这种configuration所需的步骤。

Docker运行-v将文件挂载为一个目录

我试图用-v标志将一个包含文件某个凭证的目录挂载到容器上,而不是将该文件挂载为一个文件,而是将其挂载为一个目录: 运行脚本: $ mkdir creds/ $ cp key.json creds/key.json $ ls -l creds/ total 4 -rw-r–r– 1 root root 2340 Oct 12 22:59 key.json $ docker run -v /*pathToWorkingDirectory*/creds:/creds *myContainer* *myScript* 当我查看docker run命令的debugging信息时,发现它创build/creds/目录,但由于某种原因,将key.json创build为子目录,而不是复制文件。 我已经看到一些其他的post说,如果你告诉docker run来挂载一个文件无法find,它将创build一个与文件名的容器目录,但因为我没有指定文件名,它知道名称新的目录'key.json'它似乎能够find该文件,但创build它作为一个目录吗? 有没有人遇到过这个? 如果相关,那么脚本将作为GitLab的CI进程的一部分在另一个容器中的Docker-in-Docker中运行。