liveBook · Manning

Docker named pipe

As explained in Learn Docker in a Month of Lunches, Second Edition

A Docker named pipe is a Windows interprocess communication endpoint through which clients access the Docker API.

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

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Defines the communication path, demonstrates its Compose mount, and notes full host Docker access without detailing pipe internals.
Examples
Uses Jenkins and a Windows Compose override binding \\.\pipe\docker_engine into the container.
What it assumes
Assumes familiarity with Docker containers and Compose, while defining the Windows API communication channel directly.
What you can do after
Operate/configure a containerized Jenkins service to send Docker commands to the host Engine.
How it connects
Ties named pipes to the Docker CLI, Docker API, Docker Engine, bind mounts, containers, and Docker Compose.

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.