Sphere
Log in Join
☆ 8

Is it safe to mount the Docker socket into a container?

I want to run Portainer and a backup tool that lists containers. Both need /var/run/docker.sock. How risky is that really?

⚑ Report

3 replies

☆ 0
E Emma ·2026-11-07#1

Owning the socket is effectively root on the host. Anyone who can execute inside that container can start a privileged container and mount the host filesystem.

⚑ Report
☆ 0
R Robin ·2026-11-07#2

These are my own containers on a single-user server. Is that fine?

⚑ Report
☆ 0
I Isa ·2026-11-08#3

It lowers the risk but not the blast radius. Use a read-only socket proxy if you only need to list and inspect, and keep Portainer updated.

⚑ Report
Log in to reply.