Skip to content

Commit

Permalink
Added link to generated Dockerfile to README in quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
spillai committed Oct 9, 2023
1 parent 82ab219 commit 7a33bc5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ agi-pack --install-completion <bash|zsh|fish|powershell|pwsh>
└── `docker build -f Dockerfile --target base-sklearn .`
```
That's it! Use the generated `Dockerfile` to run `docker build` and build the image directly.
That's it! Here's the generated [`Dockerfile`](examples/generated/Dockerfile-quickstart) -- use it to run `docker build` and build the image directly.
## Goals 🎯
Expand Down
63 changes: 63 additions & 0 deletions examples/generated/Dockerfile-quickstart
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"

0 comments on commit 7a33bc5

Please sign in to comment.