Actually, the runCommand is a derivation and I _do_ end up with a /tmp within the image, not a script. Without the runCommand there is no /tmp at all in the image. However, the mode of /tmp isn't what I expect.
The runAsRoot parameter is what I was looking for indeed. Thanks!
I’m trying to put together a Docker image using
dockerTools.buildImage
but I’m stuck on creating a/tmp
that all users can use.xvfb-run
in the container, and it needs write access/tmp
(it creates a folder/tmp/xvfb-run.XXXXXX
for its temporary files).xvfb-run
does not like being run asroot
.I’m failing to combine these two things.
The derivation I’m trying to use is
After creating the image I can start it and observe that
/tmp
isn’t the desired1777
but rather555
and the non-root
user can’t create dirs there.How do I create a
/tmp
with the desired mode?By adding the runContents to the
contents
you are only providing the script within the docker image, it's not executedTry this:
pasted image
Note that
runAsRoot
is only available inbuildImage
and not onbuildLayeredImage
(IIRC)Actually, the
runCommand
is a derivation and I _do_ end up with a/tmp
within the image, not a script. Without therunCommand
there is no/tmp
at all in the image. However, the mode of/tmp
isn't what I expect.The
runAsRoot
parameter is what I was looking for indeed. Thanks!