Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

746
Visualizações
Access to full /proc in Docker container

By default, Docker hides several files and directories of the container's /proc by mounting something over it:

$ docker run ubuntu:bionic findmnt -R /proc
TARGET                SOURCE              FSTYPE OPTIONS
/proc                 proc                proc   rw,nosuid,nodev,noexec,relatime
|-/proc/bus           proc[/bus]          proc   ro,relatime
|-/proc/fs            proc[/fs]           proc   ro,relatime
|-/proc/irq           proc[/irq]          proc   ro,relatime
|-/proc/sys           proc[/sys]          proc   ro,relatime
|-/proc/sysrq-trigger proc[/sysrq-trigger]
|                                         proc   ro,relatime
|-/proc/asound        tmpfs               tmpfs  ro,relatime
|-/proc/acpi          tmpfs               tmpfs  ro,relatime
|-/proc/kcore         tmpfs[/null]        tmpfs  rw,nosuid,size=65536k,mode=755
|-/proc/keys          tmpfs[/null]        tmpfs  rw,nosuid,size=65536k,mode=755
|-/proc/timer_list    tmpfs[/null]        tmpfs  rw,nosuid,size=65536k,mode=755
|-/proc/sched_debug   tmpfs[/null]        tmpfs  rw,nosuid,size=65536k,mode=755
`-/proc/scsi          tmpfs               tmpfs  ro,relatime

How can I disable this behavior in Docker (currently using version 18.09)? I need access to a proc instance without any mounts over it, otherwise nested containers (e.g., with unshare) fail because a kernel protection kicks in. One can see this with the following command:

docker run -it --security-opt="seccomp=unconfined" --cap-drop=all ubuntu:bionic unshare --fork --user --pid --mount --mount-proc --setgroups deny --map-root-user --propagation unchanged /bin/bash

This fails with unshare: mount /proc failed: Permission denied because of the mounts that are on top of /proc, and would work if Docker would not create these mounts.

I know that --privileged provides full access to /proc:

$ docker run --privileged ubuntu:bionic findmnt -R /proc
TARGET SOURCE FSTYPE OPTIONS
/proc  proc   proc   rw,nosuid,nodev,noexec,relatime

However, --privileged gives the container much more permissions (capabilities, device access, etc.) and I do not want this. I only need full access to /proc.

It would also be ok for me to have the proc file system mounted twice in the container, if one of the mounts does not have the overlapping mounts. Unfortunately, using --volume /proc:/proc2 mounts the host's /proc in the container, and I need the container's /proc. (Because of this, this questions is not a duplicate of Docker - Access host /proc).

Summary: How to get a fully visible /proc instance of the container's proc file system in a Docker container without using --privileged?

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda