Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Drupal
drupalizer
Commits
66e08b3c
Commit
66e08b3c
authored
Nov 24, 2016
by
Victor Nikulshin
Browse files
Pass UID and GID to docker run task as env variables
parent
b8755f6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
docker.py
View file @
66e08b3c
from
__future__
import
unicode_literals
import
os
from
fabric.api
import
task
,
roles
,
env
,
local
,
run
,
lcd
,
execute
from
fabric.colors
import
red
,
green
from
fabric.contrib.console
import
confirm
...
...
@@ -54,6 +56,9 @@ def docker_tryrun(imgname, containername=None, opts='', mounts=None, cmd='', res
else
:
containername_opt
=
''
opts
+=
' -e USER_ID={}'
.
format
(
os
.
getuid
())
opts
+=
' -e GROUP_ID={}'
.
format
(
os
.
getgid
())
local
(
'docker run %s %s %s %s'
%
(
opts
,
containername_opt
,
imgname
,
cmd
))
return
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment