File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515ENVIRONMENT_DIR = 'docker'
1616PRE_COMMIT_LABEL = 'PRE_COMMIT'
17+ FALLBACK_UID = 1000
18+ FALLBACK_GID = 1000
1719get_default_version = helpers .basic_get_default_version
1820healthy = helpers .basic_healthy
1921
@@ -73,11 +75,25 @@ def install_environment(
7375 os .mkdir (directory )
7476
7577
78+ def getuid ():
79+ try :
80+ return os .getuid ()
81+ except AttributeError :
82+ return FALLBACK_UID
83+
84+
85+ def getgid ():
86+ try :
87+ return os .getgid ()
88+ except AttributeError :
89+ return FALLBACK_GID
90+
91+
7692def docker_cmd (): # pragma: windows no cover
7793 return (
7894 'docker' , 'run' ,
7995 '--rm' ,
80- '-u' , '{}:{}' .format (os . getuid (), os . getgid ()),
96+ '-u' , '{}:{}' .format (getuid (), getgid ()),
8197 # https://docs.docker.com/engine/reference/commandline/run/#mount-volumes-from-container-volumes-from
8298 # The `Z` option tells Docker to label the content with a private
8399 # unshared label. Only the current container can use a private volume.
You can’t perform that action at this time.
0 commit comments