Fix Docker installation for swebench and mswebench images (#10124)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Xingyao Wang
2025-08-07 11:42:35 -04:00
committed by GitHub
parent 029a19ca05
commit 0d28113df1

View File

@@ -68,12 +68,14 @@ RUN mkdir -p /openhands && \
# ================================================================
# Define Docker installation macro
{% macro install_docker() %}
# Install Docker following official documentation
# https://docs.docker.com/engine/install/ubuntu/
# https://docs.docker.com/engine/install/debian/
RUN \
# Determine OS type and install accordingly
if [[ "{{ base_image }}" == *"ubuntu"* ]] || [[ "{{ base_image }}" == *"mswebench"* ]]; then \
if [[ "{{ base_image }}" == *"ubuntu"* ]]; then \
# Handle Ubuntu (following https://docs.docker.com/engine/install/ubuntu/)
# Add Docker's official GPG key
apt-get update && \
@@ -109,6 +111,12 @@ RUN \
# Configure Docker daemon with MTU 1450 to prevent packet fragmentation issues
RUN mkdir -p /etc/docker && \
echo '{"mtu": 1450}' > /etc/docker/daemon.json
{% endmacro %}
# Install Docker only if not a swebench or mswebench image
{% if not ('swebench' in base_image) and not ('mswebench' in base_image) %}
{{ install_docker() }}
{% endif %}
# ================================================================
{% endmacro %}