Skip to content

Commit f84d873

Browse files
Implemented a better fix to UID-related provisioning bug (fixes #131) (#133)
* container: mount temporary file to /.environment.host in read-only mode * container: fixed typos
1 parent df91612 commit f84d873

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bugzoo/container.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ def __init__(self,
6464

6565
# mount the environment file
6666
volumes[self.__env_file.name] = \
67-
{'bind': '/.environment', 'mode': 'rw'}
67+
{'bind': '/.environment.host', 'mode': 'ro'}
6868

6969
# construct a Docker container for this bug
70-
cmd = '/bin/bash -v -c "sudo chown $(whoami) /.environment && source /.environment && /bin/bash"'
70+
cmd_cp = 'sudo cp /.environment.host /.environment'
71+
cmd_chown = 'sudo chown $(whoami) /.environment'
72+
cmd_source = 'source /.environment'
73+
cmd = '/bin/bash -v -c "{} && {} && {} && /bin/bash"'.format(cmd_cp,
74+
cmd_chown,
75+
cmd_source)
7176
client = docker.from_env() # nooooooooo
7277
self.__container = \
7378
client.containers.create(bug.image,

0 commit comments

Comments
 (0)