简体   繁体   中英

Jenkins unable to connect to Windows Docker Toolbox Daemon

I have installed Docker ToolBox for Windows and Jenkins in my Windows 7 Desktop.I am attempting to create a Jenkins Job which will list down docker images available. However, in doing so I am getting the following error :-

Started by user Nilanjan Dutta Building on master in workspace C:\\Program Files (x86)\\Jenkins\\workspace\\Docker [Docker] $ cmd /c call C:\\Windows\\TEMP\\jenkins1754863637345314489.bat C:\\Program Files (x86)\\Jenkins\\workspace\\Docker>docker images error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/images/json : open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. C:\\Program Files (x86)\\Jenkins\\workspace\\Docker>exit 1 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE

I have tried adding the jenkins user in "docker users" group but I could not find the group in "Local Users and Groups" in Computer Management. Please refer the image below :- 本地组

My target is ultimately creating a CI pipeline in Jenkins where I need to build my docker image and push it to docker hub. But I am stuck in this phase and unable to proceed.

Please note that my Jenkins is a standalone installation and not a Docker Container

Below is my Docker version :- Docker version 18.03.0-ce, build 0520e24302

I am relatively new to Docker and Jenkins and is unable to proceed due to the above issue. Any help is immensely appreciated.

Today i faced the same issue (Windows 10), and solved it in following way:

Get docker toolbox env variables:

Open CMD and type Docker-machine env default

You'll get similar output:

SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://172.16.0.102:2376
SET DOCKER_CERT_PATH=C:\Users\user.docker\machine\machines\default
SET DOCKER_MACHINE_NAME=default
SET COMPOSE_CONVERT_WINDOWS_PATHS=true
REM Run this command to configure your shell:
REM @FOR /f "tokens=*" %i IN ('Docker-machine env default') DO @%i

Open Jenkins – Manage Jenkins – Configure System – Check Environment variables check box and add following environment variables:

  • DOCKER_CERT_PATH
  • DOCKER_HOST
  • DOCKER_MACHINE
  • DOCKER_TLS_VERIFY

Restart Jenkins service and you should be good to go.

Reference: Jenkins Server with local docker

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM