Skip to content
7 changes: 6 additions & 1 deletion pre_commit/languages/docker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import hashlib
import os
import subprocess
from typing import Sequence
from typing import Tuple

Expand Down Expand Up @@ -78,7 +79,11 @@ def install_environment(

def get_docker_user() -> Tuple[str, ...]: # pragma: win32 no cover
try:
return ('-u', f'{os.getuid()}:{os.getgid()}')
ver_cmd = 'docker', '--version'
if subprocess.check_output(ver_cmd).startswith(b'podman version '):
Comment thread
themr0c marked this conversation as resolved.
Outdated
return ()
else:
return ('-u', f'{os.getuid()}:{os.getgid()}')
except AttributeError:
return ()

Expand Down