subzerocloud / subzero-cli

Tooling to aid development of subZero/PostgREST based backend APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

subzero-base-project doing nothing on windows

toubsen opened this issue · comments

subzero-base-project is outputting "Downloading the base project...", then exits with exit code 0 and leaves the directory empty.

Environment:

Windows 10 Home
Docker Toolbox
subzero-cli 0.1.28 

Dumped the executed command command from inside base-project.js:

docker run  --rm -v /c/dev/subzero-test/:/src subzerocloud/subzero-cli-tools \
    sh -c "mkdir -p . && wget -qO- https://github.com/subzerocloud/subzero-starter-kit/archive/master.tar.gz | tar xz -C . --strip-components=1"

This runs fine + exits also with exit code 0. Seems like the mapped /src is probably not where the unpacked files end up.

Poking a bit more at it:

docker run --rm -v /c:/src subzerocloud/subzero-cli-tools sh -c "ls -la"
total 8
drwxr-xr-x    4 root     root            80 Mar  8 00:12 .
drwxr-xr-x    1 root     root          4096 Mar  8 00:12 ..
dr-xr-xr-x    1 1000     50            4096 May 20  2018 Users
drwxr-xr-x    3 root     root            60 Mar  7 23:21 dev

So it seems, something is there and was persisted somewhere. Inside /c/Users I find my regular profile folder content. But inside /c/dev no content visible from Windows Explorer is visible + what is visible inside the container is not visible outside in Windows Explorer.

Out of ideas from here, possibly due to lacking knowledge of Docker tooling + gotchas.

@toubsen I think your problem is somewhere along these lines
https://stackoverflow.com/questions/33126271/how-to-use-volume-option-with-docker-toolbox-on-windows (see the top answer from @jmgoyesc, that one seems about right from memory )

when using docker through virtualbox (windows home) in addition to mapping using -v in docker, for a folder to be visible, you need to also configure virtual box to have that drive/folder available and by default I think only C:\Users is configured

PS: docker on windows home is a bit of a workaround and is the reason I upgraded to Professional, If you get into docker and like it, see if you can upgrade your os to pro (which has support for Hyper-V which is needed by docker to run natively).

Thank you - that's exactly it.

Might make sense to add a small hint in the docs, or - even better - integrate at minimum a console.log() warning inside base-project.js in the win32 + virtualbox check, if the path does not match the pattern \/[a-zA-Z]\/Users (will be in english on all Windows language versions).

Will be able to use Docker in Win Pro at work. Just wanted to evaluate SubZero at home in my private time, if it makes sense to invest time + evangelize at work.