Skip to content

fix: Prevent interactive prompts in Docker build#3

Draft
AlexCuadron wants to merge 4 commits intomainfrom
fix-docker-build-prompt-v2
Draft

fix: Prevent interactive prompts in Docker build#3
AlexCuadron wants to merge 4 commits intomainfrom
fix-docker-build-prompt-v2

Conversation

@AlexCuadron
Copy link
Owner

@AlexCuadron AlexCuadron commented Feb 17, 2025

This PR fixes the Docker build issue where it gets stuck on "Delete 1061 entries? (yes/no) [yes] Aborted" by modifying the Dockerfile template to prevent interactive prompts:

  1. Setting non-interactive environment variables in the Dockerfile:

    ENV DEBIAN_FRONTEND=noninteractive \
        DEBCONF_NONINTERACTIVE_SEEN=true
  2. Configuring debconf to use non-interactive frontend:

    echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
  3. Adding force flags to cleanup commands:

    apt-get clean -y && \
    apt-get autoremove -y && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
    yes | /openhands/micromamba/bin/micromamba clean --all --force-pkgs-dirs
  4. Setting micromamba to always accept prompts:

    CONDA_ALWAYS_YES=true /openhands/micromamba/bin/micromamba create -n openhands -y
  5. Handling Playwright installation non-interactively:

    # Install playwright and its dependencies non-interactively
    DEBIAN_FRONTEND=noninteractive /openhands/micromamba/bin/micromamba run -n openhands poetry run pip install playwright && \
    DEBIAN_FRONTEND=noninteractive PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 /openhands/micromamba/bin/micromamba run -n openhands poetry run playwright install --with-deps chromium && \
    yes | /openhands/micromamba/bin/micromamba run -n openhands poetry run playwright install chromium

These changes ensure that Docker builds run without requiring manual intervention while maintaining the same functionality.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant