mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
Configurable conda/mamba channel_alias for runtime builds (#11516)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -52,12 +52,16 @@ def _generate_dockerfile(
|
||||
)
|
||||
template = env.get_template('Dockerfile.j2')
|
||||
|
||||
# Allow overriding conda/mamba channel alias (e.g., to avoid anaconda.org)
|
||||
channel_alias = os.getenv('OH_CONDA_CHANNEL_ALIAS', '').strip() or None
|
||||
|
||||
dockerfile_content = template.render(
|
||||
base_image=base_image,
|
||||
build_from_scratch=build_from == BuildFromImageType.SCRATCH,
|
||||
build_from_versioned=build_from == BuildFromImageType.VERSIONED,
|
||||
extra_deps=extra_deps if extra_deps is not None else '',
|
||||
enable_browser=enable_browser,
|
||||
channel_alias=channel_alias,
|
||||
)
|
||||
return dockerfile_content
|
||||
|
||||
|
||||
@@ -275,6 +275,9 @@ RUN \
|
||||
RUN mkdir -p /openhands/micromamba/bin && \
|
||||
/bin/bash -c "PREFIX_LOCATION=/openhands/micromamba BIN_FOLDER=/openhands/micromamba/bin INIT_YES=no CONDA_FORGE_YES=yes $(curl -L https://micro.mamba.pm/install.sh)" && \
|
||||
/openhands/micromamba/bin/micromamba config remove channels defaults && \
|
||||
{%- if channel_alias %}
|
||||
/openhands/micromamba/bin/micromamba config set channel_alias '{{ channel_alias }}' && \
|
||||
{%- endif %}
|
||||
/openhands/micromamba/bin/micromamba config list && \
|
||||
chown -R openhands:openhands /openhands/micromamba && \
|
||||
# Create read-only shared access to micromamba for all users
|
||||
|
||||
Reference in New Issue
Block a user