From 9651368e6ae74513ab7f9c1aeee32708ea239191 Mon Sep 17 00:00:00 2001 From: tobitege <10787084+tobitege@users.noreply.github.com> Date: Fri, 27 Sep 2024 23:49:51 +0200 Subject: [PATCH] revert #3871 dockerfile template: don't write to .bashrc file (#4095) --- .github/workflows/ghcr-build.yml | 8 ++++++-- .../runtime/utils/runtime_templates/Dockerfile.j2 | 13 +------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ghcr-build.yml b/.github/workflows/ghcr-build.yml index 71f36b85fb..ebc40d8851 100644 --- a/.github/workflows/ghcr-build.yml +++ b/.github/workflows/ghcr-build.yml @@ -56,7 +56,9 @@ jobs: docker-images: false swap-storage: true - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v3.0.0 + with: + image: tonistiigi/binfmt:latest - name: Login to GHCR uses: docker/login-action@v3 with: @@ -118,7 +120,9 @@ jobs: docker-images: false swap-storage: true - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v3.0.0 + with: + image: tonistiigi/binfmt:latest - name: Login to GHCR uses: docker/login-action@v3 with: diff --git a/openhands/runtime/utils/runtime_templates/Dockerfile.j2 b/openhands/runtime/utils/runtime_templates/Dockerfile.j2 index 86dbaf4a88..57ea62dba2 100644 --- a/openhands/runtime/utils/runtime_templates/Dockerfile.j2 +++ b/openhands/runtime/utils/runtime_templates/Dockerfile.j2 @@ -69,8 +69,7 @@ RUN \ /openhands/miniforge3/bin/mamba run -n base poetry run pip install playwright && \ /openhands/miniforge3/bin/mamba run -n base poetry run playwright install --with-deps chromium && \ # Set environment variables - export OH_INTERPRETER_PATH=$(/openhands/miniforge3/bin/mamba run -n base poetry run python -c "import sys; print(sys.executable)") && \ - export OH_VENV_PATH=$(/openhands/miniforge3/bin/mamba run -n base poetry env info --path) && \ + echo "OH_INTERPRETER_PATH=$(/openhands/miniforge3/bin/mamba run -n base poetry run python -c "import sys; print(sys.executable)")" >> /etc/environment && \ # Install extra dependencies if specified {{ extra_deps }} {% if extra_deps %} && {% endif %} \ # Clear caches @@ -81,16 +80,6 @@ RUN \ # Clean up apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ /openhands/miniforge3/bin/mamba clean --all -{% if not skip_init %} -RUN \ - # Add the Poetry virtual environment to the bashrc - echo "export OH_INTERPRETER_PATH=\"$OH_INTERPRETER_PATH\"" >> /etc/bash.bashrc && \ - echo "export OH_VENV_PATH=\"$OH_VENV_PATH\"" >> /etc/bash.bashrc && \ - # Activate the Poetry virtual environment - echo 'source "$OH_VENV_PATH/bin/activate"' >> /etc/bash.bashrc && \ - # Use the Poetry virtual environment's Python interpreter - echo 'alias python="$OH_INTERPRETER_PATH"' >> /etc/bash.bashrc -{% endif %} # ================================================================ # END: Copy Project and Install/Update Dependencies # ================================================================