Skip to content

Commit

Permalink
add docker to sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Aug 15, 2024
1 parent ac26960 commit c145a4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions opendevin/runtime/client/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ async def _init_container(

if mount_dir is not None:
volumes = {mount_dir: {'bind': sandbox_workspace_dir, 'mode': 'rw'}}
# mount sock
volumes['/var/run/docker.sock'] = {
'bind': '/var/run/docker.sock',
'mode': 'rw',
}
logger.info(f'Mount dir: {sandbox_workspace_dir}')
else:
logger.warn(
Expand Down
4 changes: 2 additions & 2 deletions opendevin/runtime/utils/runtime_templates/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FROM {{ base_image }}

# Install necessary packages and clean up in one layer
RUN apt-get update && \
apt-get install -y wget sudo apt-utils {{ LIBGL_MESA }} libasound2-plugins git && \
apt-get install -y wget sudo apt-utils {{ LIBGL_MESA }} libasound2-plugins git docker.io && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -54,7 +54,7 @@ RUN cd /opendevin/code && \
/opendevin/miniforge3/bin/mamba run -n base poetry env use python3.11 && \
/opendevin/miniforge3/bin/mamba run -n base poetry install --only main,runtime --no-interaction --no-root && \
apt-get update && \
/opendevin/miniforge3/bin/mamba run -n base poetry run pip install playwright && \
/opendevin/miniforge3/bin/mamba run -n base poetry run pip install playwright docker && \
/opendevin/miniforge3/bin/mamba run -n base poetry run playwright install --with-deps chromium && \
export OD_INTERPRETER_PATH=$(/opendevin/miniforge3/bin/mamba run -n base poetry run python -c "import sys; print(sys.executable)") && \
{{ extra_deps }} {% if extra_deps %} && {% endif %} \
Expand Down

0 comments on commit c145a4d

Please sign in to comment.