diff --git a/cli50/__main__.py b/cli50/__main__.py index 8d3d4d4..7659632 100644 --- a/cli50/__main__.py +++ b/cli50/__main__.py @@ -213,6 +213,7 @@ def main(): "--security-opt", "seccomp=unconfined", # https://stackoverflow.com/q/35860527#comment62818827_35860527, https://github.com/apple/swift-docker/issues/9#issuecomment-328218803 "--tty", "--volume", directory + ":" + workdir, + "--volume", "/var/run/docker.sock:/var/run/docker-host.sock", # https://github.com/devcontainers/features/blob/main/src/docker-outside-of-docker/devcontainer-feature.json "--workdir", workdir] # Check for locale @@ -259,6 +260,13 @@ def main(): ["--publish-all"] + [f"{IMAGE}:{args['tag']}"] + cmd).decode("utf-8").rstrip() + # Start Docker-outside-of-Docker (if supported by TAG) + # a la https://github.com/devcontainers/features/blob/main/src/docker-outside-of-docker/install.sh + try: + subprocess.check_output(["docker", "exec", container, "sudo", "/etc/init.d/docker", "start"]) + except subprocess.CalledProcessError: + pass + # List port mappings print(ports(container)) diff --git a/setup.py b/setup.py index f3abffc..55facbb 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,6 @@ "console_scripts": ["cli50=cli50.__main__:main"] }, url="https://github.com/cs50/cli50", - version="7.4.1", + version="7.5.0", include_package_data=True )