Commit a0e134fb authored by Teake Nutma's avatar Teake Nutma
Browse files

Use entrypoint for conda-builder

Otherwise conda cannot be found by GitLab CI.
parent 9e6b4b0b
......@@ -23,30 +23,27 @@ RUN yum -y update \
RUN curl -L https://github.com/conda-forge/miniforge/releases/download/4.11.0-0/Mambaforge-4.11.0-0-Linux-x86_64.sh -o mambaforge.sh \
&& bash mambaforge.sh -b -p ${CONDA_INSTALL_DIR} \
&& rm mambaforge.sh \
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
&& source /opt/conda/etc/profile.d/conda.sh \
&& conda activate \
&& conda config --set show_channel_urls True \
&& conda config --set channel_priority strict \
&& ${CONDA_INSTALL_DIR}/bin/conda config --set show_channel_urls True \
&& ${CONDA_INSTALL_DIR}/bin/conda config --set channel_priority strict \
# There are just too many packages that clobber paths. So don't set to
# path_conflict to `prevent` -- else we'll be overriding this setting to
# `warn` in lots of projects.
&& conda config --set path_conflict warn \
&& conda config --set notify_outdated_conda false \
&& ${CONDA_INSTALL_DIR}/bin/conda config --set path_conflict warn \
&& ${CONDA_INSTALL_DIR}/bin/conda config --set notify_outdated_conda false \
# Set the variant file to the one from conda-forge-pinning.
# The conda-forge-pinning package (installed below) puts its variant
# file in $CONDA_INSTALL_DIR. Pointing conda-build to that variant file
# ensures we're compiling against libraries compatible with the wider
# conda-forge ecosystem.
&& conda config --set conda_build.config_file ${CONDA_INSTALL_DIR}/conda_build_config.yaml \
&& ${CONDA_INSTALL_DIR}/bin/conda config --set conda_build.config_file ${CONDA_INSTALL_DIR}/conda_build_config.yaml \
# Explicitly fail when overlinking shared libraries. This will prevent dynamic library linking issues,
# and will be the default setting in conda build 4.0 anyway.
&& conda config --set conda_build.error_overlinking True \
&& ${CONDA_INSTALL_DIR}/bin/conda config --set conda_build.error_overlinking True \
# Explicitly install a specific build of requests because of a chardet incompability.
# See https://github.com/conda-forge/requests-feedstock/pull/54. \
# TODO: when the metadata of the affected requests packages has been patched,
# remove the `requests` line.
&& conda install --yes --update-all \
&& ${CONDA_INSTALL_DIR}/bin/conda install --yes --update-all \
conda-build \
conda-verify \
mamba \
......@@ -55,8 +52,13 @@ RUN curl -L https://github.com/conda-forge/miniforge/releases/download/4.11.0-0/
coverage-fixpaths \
conda-forge-pinning=${CONDA_FORGE_PINNING} \
requests=2.28.0=pyhd8ed1ab_1 \
&& conda clean -tipy \
&& conda-build purge-all
&& ${CONDA_INSTALL_DIR}/bin/conda clean -tipy \
&& ${CONDA_INSTALL_DIR}/bin/conda-build purge-all \
&& ${CONDA_INSTALL_DIR}/bin/conda init bash
# Add a shell script that activates conda ...
COPY entrypoint.sh /opt/docker/bin/entrypoint.sh
# ... and make it the Docker entrypoint so that conda is available when we run a container.
ENTRYPOINT [ "/bin/bash", "/opt/docker/bin/entrypoint.sh" ]
# Provide a default command (`bash`), which will start if the user doesn't specify one.
CMD [ "/bin/bash" ]
#!/bin/sh
# GitLab runner doesn't source .bashrc, so we do it ourselves.
. ~/.bashrc
# Run whatever the user wants to.
exec "$@"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment