I'm building a server that will build images directly from Dockerfile:
docker build -t arbitrarydocker .
This docker file will be built on the same server as other client Dockerfiles, which may have secrets. How can I lock down the process that does docker build -t arbitrarydocker .
so that it doesn't do things like:
ADD /contents/of/host/secrets ./space/in/hacker/docker/container
The best way I can think is to fork the process and run it with a made up user that has limited directory access to only one folder where its own secrets are kept with limited capabilities. Also wondering if there's a way to totally wipe out memory after dockerfile is built so data is not leaked to next client build.
If the only way to do it securely is to have a dedicated build server per client, then I can do that, but I'd like to avoid it.
All builds are done on Centos.