mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-08 00:09:15 -05:00
Merge pull request #642 from jimmidyson/docker-selinux
Add selinux labelling option to docker_image hook type
This commit is contained in:
@@ -82,7 +82,10 @@ def docker_cmd():
|
|||||||
'docker', 'run',
|
'docker', 'run',
|
||||||
'--rm',
|
'--rm',
|
||||||
'-u', '{}:{}'.format(os.getuid(), os.getgid()),
|
'-u', '{}:{}'.format(os.getuid(), os.getgid()),
|
||||||
'-v', '{}:/src:rw'.format(os.getcwd()),
|
# https://docs.docker.com/engine/reference/commandline/run/#mount-volumes-from-container-volumes-from
|
||||||
|
# The `Z` option tells Docker to label the content with a private
|
||||||
|
# unshared label. Only the current container can use a private volume.
|
||||||
|
'-v', '{}:/src:rw,Z'.format(os.getcwd()),
|
||||||
'--workdir', '/src',
|
'--workdir', '/src',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user