A Docker named pipe is a private Windows communication channel that lets the Docker CLI connect to the Docker API on the local Docker Engine. section 11.2
Mount the pipe into a container when software inside that container must query Docker or start and stop other containers. This grants full access to Docker features on the host, so use it only with trusted images. section 11.2
Bind Jenkins to Docker on Windows
In a Windows Compose override, bind the host pipe \\.\pipe\docker_engine to the same path in the Jenkins container using the npipe volume type. Jenkins can then run Docker and Docker Compose commands against the host Engine. section 11.2
Listing 11.1 Binding the Docker CLI in Jenkins to the Docker Engine
# docker-compose.yml
services:
jenkins:
image: diamol/jenkins:2e
ports:
- "8080:8080"
networks:
- infrastructure
# docker-compose-linux.yml
jenkins:
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
# docker-compose-windows.yml
jenkins:
volumes:
- type: npipe
source: \\.\pipe\docker_engine
target: \\.\pipe\docker_engine
Use the complete Compose listing to compare the Windows named-pipe binding with the Linux Docker socket binding. section 11.2
