0

My Dockerfile builds a library whose build script uses the docker build command internally. Such nesting does not seem supported: Ubuntu 18.04 image fails with docker: command not found and installing Docker changes the error message to /tmp/docker.sock: no such file or directory.

The docker run command offers several ways to nest containers:

  1. running the outermost docker run command in privileged mode,
  2. sharing the /var/run/docker.sock socker with containers.

Is any similar option available for docker build?

Witiko
  • 3,167
  • 3
  • 25
  • 43
  • Maybe docker [multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds) can help? – Ralf Feb 09 '21 at 08:54
  • Not without tinkering with the build script of the library, I would imagine. The build script does more than run `docker build`, so I would like to run it unedited and containerized. – Witiko Feb 09 '21 at 08:54

0 Answers0