I have an application which uses docker to build itself, and I want to build a docker image of it. This requires exposing the docker.sock
to the application during the docker build
command (similar to adding a -v /var/run/docker.sock:/var/run/docker.sock
argument to a docker run
command).
It there any way I can do this or should I resort to building in a virtual machine and copying the build artefacts into a container?
The Dockerfile
look like this:
FROM docker
RUN docker run --rm -v /opt/<myapp>:/opt/<myapp> <myapp> /build_and_install.sh /opt/<myapp>
# etc...