tailhook / vagga

Vagga is a containerization tool without daemons
http://vagga.readthedocs.org
MIT License
1.86k stars 96 forks source link

!Sh 'git clone --recurse-submodules creates directory outside container #514

Closed bootchk closed 5 years ago

bootchk commented 5 years ago

!Sh 'git clone --recurse-submodules git://github.com/flathub/org.gimp.GIMP' seems to create a directory org.gimp.GIMP at the top i.e. in parent directory of vagga.yaml, i.e. not in the container. That seems bad.

I suppose I can use !Git and do the recursion myself.

(Is it best to ask here, or on Gitter?)

Using vagga v0.8.1. The first part of vagga.yaml is this:

`baseOS: setup:

base OS is ubuntu 18.10

# - !Ubuntu xenial
- !Ubuntu cosmic
# - !Ubuntu disco

# tools for dev (C compiler)
- !Install [build-essential]

# need git in container for later recurse git submodules
- !Install [git]

# To use https, need certificates
# Symptom is: "Unacceptable TLS certificate"
- !Install [ca-certificates]

- !Sh 'rm /etc/resolv.conf'`
tailhook commented 5 years ago

seems to create a directory org.gimp.GIMP at the top i.e. in parent directory of vagga.yaml, i.e. not in the container. That seems bad.

That's a principle of minimum surprise. I.e. any command runs in the parent directory of vagga.yaml. Unfortunately, this includes commands doing filesystem mutations like git clone. You can either cd into a dir !Sh 'cd /some-dir; git clone... or use !Git command (i'm not sure about submodules in the latter)

bootchk commented 5 years ago

oops, I thought sh would run inside the container, and assumed pwd would be say ~.