我正在发现gitlab-ci,我想创建一个管道,该管道在每次提交后执行sqlplus命令。 为此,我使用了dockerhub sqlplus镜像sflyr / sqlplus。
我的.gitlab-ci.yml:
build:
image: sflyr/sqlplus
stage: build
services:
- docker:dind
script:
- docker run -e URL=<user>/<password>@//xxx.yyy.eu-west-1.rds.amazonaws.com:1521/ORCL -ti sflyr/sqlplus
我有错误: / bin / bash:第87行:docker:找不到命令
这是使用dockerhub映像的正确方法吗? 我想我需要将Docker映像与sqlplus服务一起使用,但是我不确定该服务是否存在。
在@ frakman1的答案后进行编辑:
新的.gitlab-ci.yml:
image: nandkrishnamoorthy/ubuntu-32bit
stages:
- build
code_quality:
stage: build
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- docker -v
- docker pull container-registry.oracle.com/database/instantclient:12.2.0.1
- docker run -ti --rm container-registry.oracle.com/database/instantclient sqlplus ***/***@***:1532/****
新错误:
$ docker -v
Docker version 19.03.5,build 633a0ea838
$ docker pull container-registry.oracle.com/database/instantclient:12.2.0.1
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ERROR: Job failed: command terminated with exit code 1
我尝试了sudo,但没有用。