10

How to build a Docker image with privileged capabilities, like when running docker run -ti --privileged?

So I can mount a device while building my Dockerfile without getting an automount error?

Willian Paixao
  • 2,691
  • 3
  • 18
  • 33
Ijaz Ahmad
  • 7,146
  • 5
  • 32
  • 45

1 Answers1

1

It's not possible to build Docker images in a privileged mode as you do when you run a container. [1]

root is already the default user when building or running your Docker container, although as you pointed out, some commands will fail, like mount a partition for example. [2] [3]

Willian Paixao
  • 2,691
  • 3
  • 18
  • 33