Skip to content

Is mounting /var/run/docker.sock mandatory for a server container to access Docker daemon? #486

@winrunwang

Description

@winrunwang

I have packaged my server service into a Docker image. When starting the container, I want the service inside to be able to access the Docker daemon on the host.

I found a common solution like this:I have packaged my server service into a Docker image. When starting the container, I want the service inside to be able to access the Docker daemon on the host.

I found a common solution like this:

docker run -d \ --name opensandbox-server \ -p 8080:8080 \ -v /var/run/docker.sock:/var/run/docker.sock \ opensandbox-server

I want to confirm:

  1. Is mounting /var/run/docker.sock the only way for the containerized server to access the Docker daemon?
  2. If there are other secure and compliant approaches to let the container access Docker daemon without mounting /var/run/docker.sock, what are they?

In my company, mounting /var/run/docker.sock violates internal security policies, so I need an alternative solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions