floki icon indicating copy to clipboard operation
floki copied to clipboard

Are there nice ways to get `git` (with submodules) working inside containers

Open rlupton20 opened this issue 5 years ago • 6 comments

e.g. git submodule update --init is bound to fail since it uses absolute paths.

rlupton20 avatar May 29 '19 09:05 rlupton20

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?)

bossmc avatar May 29 '19 09:05 bossmc

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).

cswindle avatar Jun 03 '19 08:06 cswindle

@bossmc sounds like a reasonable idea.

rlupton20 avatar Jun 09 '19 12:06 rlupton20

#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.

rlupton20 avatar Jun 09 '19 12:06 rlupton20

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

rlupton20 avatar Jun 09 '19 12:06 rlupton20

@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.

rlupton20 avatar Aug 10 '19 09:08 rlupton20