-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added link to generated
Dockerfile
to README in quickstart
- Loading branch information
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# >>>>>>>>>>>>>>>>>>>>>>>>>>> | ||
# Auto-generated by agi-pack. | ||
FROM debian:buster-slim AS base-cpu | ||
|
||
# Setup environment variables | ||
ENV PROJECT agi | ||
ENV PYENV agi-py38 | ||
ENV PYTHON_VERSION 3.8 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONWARNINGS ignore | ||
|
||
# Setup conda paths | ||
ENV CONDA_PATH=/opt/conda/envs/${PYENV} | ||
ENV CONDA_PREFIX=${CONDA_PATH} | ||
ENV CONDA_EXE=${CONDA_PATH}/bin/conda | ||
ENV PATH=${CONDA_PATH}/bin:/opt/conda/bin:$PATH | ||
ENV CONDA_DEFAULT_ENV ${PYENV} | ||
|
||
# Setup environment variables | ||
ENV MY_ENV_VAR=value | ||
|
||
# Install system packages | ||
RUN apt-get -y update \ | ||
&& apt-get -y install \ | ||
curl git \ | ||
wget \ | ||
&& apt-get -y autoclean \ | ||
&& apt-get -y autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install mambaforge | ||
RUN curl -sLo ~/mambaforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" \ | ||
&& chmod +x ~/mambaforge.sh \ | ||
&& ~/mambaforge.sh -b -p /opt/conda \ | ||
&& /opt/conda/bin/mamba init bash \ | ||
&& /opt/conda/bin/mamba config --set pip_interop_enabled True \ | ||
&& /opt/conda/bin/mamba create -n ${PYENV} python=${PYTHON_VERSION} -y \ | ||
&& rm ~/mambaforge.sh | ||
|
||
# Install pip packages, with cache mounting /opt/conda/pkgs for faster builds | ||
# Note: Cache mounts allow us to re-use the cache for conda packages | ||
# instead of having to re-download them every time we build. | ||
RUN --mount=type=cache,target=/opt/conda/pkgs/ \ | ||
mamba install -yv \ | ||
loguru \ | ||
scikit-learn \ | ||
&& echo "pip install complete" | ||
|
||
# Export conda environment on login | ||
RUN echo "export CONDA_PATH=/opt/conda/envs/${PYENV}" >> ~/.bashrc | ||
RUN echo "export PATH=/opt/conda/envs/${PYENV}/bin:$PATH" >> ~/.bashrc | ||
RUN echo "export CONDA_DEFAULT_ENV=${PYENV}" >> ~/.bashrc | ||
RUN echo "mamba activate ${PYENV}" > ~/.bashrc | ||
ENTRYPOINT ["/bin/bash", "-c"] | ||
|
||
# Setup working directory | ||
WORKDIR /app/$PYENV | ||
|
||
# Run commands | ||
RUN \ | ||
ls -la \ | ||
&& echo "run commands complete" |