gpt4 book ai didi

docker - 为gitlab ci社区版启用docker

转载 作者:行者123 更新时间:2023-12-02 18:16:32 24 4
gpt4 key购买 nike

我在启用docker进行构建工作时遇到困难。这是gitlab ci配置文件的样子:

image: docker:latest

services:
- docker:dind

stages:
- build

build:
image: java:8
stage: build
script:
- docker info
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com/...
- sbt server/docker:publish

这是作业的输出:
gitlab-ci-multi-runner 1.3.2 (0323456)
Using Docker executor with image java:8 ...
Pulling docker image docker:dind ...
Starting service docker:dind ...
Waiting for services to be up and running...
Pulling docker image java:8 ...
Running on runner-30dcea4b-project-1408237-concurrent-0 via runner-30dcea4b-machine-1470340415-c2bbfc45-digital-ocean-4gb...
Cloning repository...
Cloning into '/builds/.../...'...
Checking out 9ba87ff0 as master...
$ docker info
/bin/bash: line 42: docker: command not found

ERROR: Build failed: exit code 1

为什么找不到docker的任何线索?

最佳答案

docker info命令正在基于java:8的容器中运行,该容器中未安装/可用docker。

关于docker - 为gitlab ci社区版启用docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38776660/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com