Skip to content

Commit

Permalink
add ollama installation to Dockerfile and test
Browse files Browse the repository at this point in the history
  • Loading branch information
AntFMoJ committed Mar 19, 2024
1 parent 9794c72 commit 601b981
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ ENV CONTAINER_USER="analyticalplatform" \
VISUAL_STUDIO_CODE_VERSION="1.87.2-1709912201" \
AWS_CLI_VERSION="2.15.28" \
MINICONDA_VERSION="24.1.2-0" \
MINICONDA_SHA265="8eb5999c2f7ac6189690d95ae5ec911032fa6697ae4b34eb3235802086566d78" \
MINICONDA_SHA256="8eb5999c2f7ac6189690d95ae5ec911032fa6697ae4b34eb3235802086566d78" \
OLLAMA_VERSION="0.1.29" \
PATH="/opt/conda/bin:${PATH}"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand Down Expand Up @@ -96,13 +97,19 @@ RUN gpg --import /opt/aws-cli/[email protected] \
RUN curl --location --fail-with-body \
"https://repo.anaconda.com/miniconda/Miniconda3-py310_${MINICONDA_VERSION}-Linux-x86_64.sh" \
--output "miniconda.sh" \
&& echo "${MINICONDA_SHA265} miniconda.sh" | sha256sum --check \
&& echo "${MINICONDA_SHA256} miniconda.sh" | sha256sum --check \
&& bash miniconda.sh -b -p /opt/conda \
&& rm --force miniconda.sh

COPY --chown=nobody:nobody --chmod=0755 src/usr/local/bin/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY --chown=nobody:nobody --chmod=0755 src/usr/local/bin/healthcheck.sh /usr/local/bin/healthcheck.sh

# Ollama
RUN curl --location --fail-with-body \
"https://github.com/ollama/ollama/releases/download/v${OLLAMA_VERSION}/ollama-linux-amd64" \
--output "ollama" \
&& install --owner=root --group=root --mode=775 ollama /usr/local/bin/ollama

USER ${CONTAINER_USER}

WORKDIR /home/${CONTAINER_USER}
Expand Down
5 changes: 5 additions & 0 deletions test/container-structure-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ commandTests:
args: ["--version"]
expectedOutput: ["pip.*"]

- name: "ollama"
command: "ollama"
args: ["--version"]
expectedOutput: ["*version*"]

fileContentTests:
- name: "bashrc first-run-notice"
path: "/etc/bash.bashrc"
Expand Down

0 comments on commit 601b981

Please sign in to comment.