Я пытаюсь запустить команды Docker в Дженкинс ShellRun Docker команды в Дженкинс Shell
Команда оболочки, что я пытаюсь это
# optional: record current versions of docker apps with each build
docker -v && docker-compose -v && docker-machine -v
# set-up: clean up any previous machine failures
docker-machine stop test || echo "nothing to stop" && \
docker-machine rm test || echo "nothing to remove"
# use docker-machine to create and configure 'test' environment
# add a -D (debug) if having issues
docker-machine create --driver virtualbox test
eval "$(docker-machine env test)"
# use docker-compose to pull and build new images and containers
docker-compose -p jenkins up -d
# optional: list machines, images, and containers
docker-machine ls && docker images && docker ps -a
# wait for containers to fully start before tests fire up
sleep 30
# test services
sh tests.sh $(docker-machine ip test)
# tear down: stop and remove 'test' environment
#docker-machine stop test && docker-machine rm test
Кто-нибудь знает, как настроить Дженкинс для выполнения команд Докер (docker
, docker-compose
и docker-machine
)?
UPDATE (Сообщение об ошибке)
Started by user anonymous
Building in workspace /Users/Shared/Jenkins/Home/jobs/Virtual-Vehicles_Docker_Machine/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/garystafford/virtual-vehicles-docker.git # timeout=10
Fetching upstream changes from https://github.com/garystafford/virtual-vehicles-docker.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress https://github.com/garystafford/virtual-vehicles-docker.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 433683c8b9da5272b9f98c9a9653aac5bfb8c0b5 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 433683c8b9da5272b9f98c9a9653aac5bfb8c0b5
> git rev-list 433683c8b9da5272b9f98c9a9653aac5bfb8c0b5 # timeout=10
[workspace] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson5615310598120649485.sh
+ docker -v
/Users/Shared/Jenkins/tmp/hudson5615310598120649485.sh: line 3: docker: command not found
+ docker-machine stop test
/Users/Shared/Jenkins/tmp/hudson5615310598120649485.sh: line 6: docker-machine: command not found
+ echo 'nothing to stop'
nothing to stop
+ docker-machine rm test
/Users/Shared/Jenkins/tmp/hudson5615310598120649485.sh: line 7: docker-machine: command not found
+ echo 'nothing to remove'
nothing to remove
+ docker-machine create --driver virtualbox test
/Users/Shared/Jenkins/tmp/hudson5615310598120649485.sh: line 11: docker-machine: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Команда докер версия
Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 22:37:33 2016
OS/Arch: darwin/amd64
Server:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 22:37:33 2016
OS/Arch: linux/amd64
Команда докер-компоновать -v
docker-compose version 1.6.0, build d99cad6
Команда докер-машина -v
docker-machine version 0.6.0, build e27fb87
Доккер уже установлен на машине Дженкинс установлен на? Вы уже видели плагины Дженкина для докеров? С какими конкретными проблемами вы столкнулись? –
Здесь я не вижу сообщений об ошибках. – larsks
привет @larsks, я добавил сообщение об ошибке –