floki
floki copied to clipboard
Are there nice ways to get `git` (with submodules) working inside containers
e.g. git submodule update --init
is bound to fail since it uses absolute paths.
Could/should floki mount the working dir at its path in the host (rather than at /src
)? Probably hidden behind a config flag (as your init script needs to be aware of this... maybe add a WORKDIR
too?)
This works better for rust as well, as if you change the path it recompiles everything (which is fine if you always use floki for everything, but a pain otherwise).
@bossmc sounds like a reasonable idea.
#19 adds an environment variable which contains the host working directory (FLOKI_HOST_WORKDIR
), since that seems to be the absolute minimum needed (I think bind mounts would unlock the rest, in a pinch).
I'll probably end up forwarding the mount path too, but I want to think and test it a little more.
Actually, simpler than bind mounts, a symlink might do it.
init:
- mkdir -p $(dirname $FLOKI_HOST_WORKDIR)
- ln -s $FLOKI_HOST_WORKDIR link
- cd link
@bossmc don't know why I've been sitting on the idea of mirroring the host path as an option for so long. It just occurred to me today it makes enough things easier that it's worth doing.
Will see if I can get to it this weekend/week.