diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec77a86..e5bbddf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,8 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' @@ -36,7 +36,7 @@ jobs: - name: Create Release if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ github.token }} script: | diff --git a/cli50/__main__.py b/cli50/__main__.py index 8444936..279d0e1 100644 --- a/cli50/__main__.py +++ b/cli50/__main__.py @@ -206,6 +206,7 @@ def main(): # Options workdir = "/mnt" options = ["--detach", + "--env", f"LOCAL_WORKSPACE_FOLDER={directory}", "--env", f"TZ={tzlocal.get_localzone_name()}", "--env", f"WORKDIR={workdir}", "--interactive", @@ -214,6 +215,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 @@ -260,6 +262,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 002f049..aba1292 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.2", + version="7.5.1", include_package_data=True )