Skip to content

Commit

Permalink
make the docker build more customizeable (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
masci authored Oct 21, 2024
1 parent 7e12c2c commit 73ea594
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ ARG dist_image
FROM $build_image AS build-image

Check warning on line 4 in docker/Dockerfile.base

View workflow job for this annotation

GitHub Actions / Build base image

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $build_image results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

ARG llama_deploy_version
ARG llama_deploy_version_sha
ARG llama_deploy_extras=""
ARG git_clone_options

RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
git

# Shallow clone the repo, we install from git
RUN git clone --depth=1 --branch=${llama_deploy_version} https://github.com/run-llama/llama_deploy.git /opt/llama_deploy
RUN git clone ${git_clone_options} --branch=${llama_deploy_version} https://github.com/run-llama/llama_deploy.git /opt/llama_deploy
WORKDIR /opt/llama_deploy
RUN git checkout ${llama_deploy_version_sha}

# Use a virtualenv we can copy over the next build stage
RUN python3 -m venv --system-site-packages /opt/venv
Expand Down
10 changes: 10 additions & 0 deletions docker/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ variable "LLAMA_DEPLOY_VERSION" {
default = "main"
}

variable "LLAMA_DEPLOY_VERSION_SHA" {
default = ""
}

variable "GIT_CLONE_OPTIONS" {
default = "--depth=1"
}

variable "BUILD_IMAGE" {
default = "python:3.12-slim"
}
Expand All @@ -29,7 +37,9 @@ target "default" {
build_image = "${BUILD_IMAGE}"
dist_image = "${DIST_IMAGE}"
llama_deploy_version = "${LLAMA_DEPLOY_VERSION}"
llama_deploy_version_sha = "${LLAMA_DEPLOY_VERSION_SHA}"
llama_deploy_extras = "[awssqs, rabbitmq, kafka, redis]"
git_clone_options = "${GIT_CLONE_OPTIONS}"
apiserver_port = "${APISERVER_PORT}"
}
platforms = ["linux/amd64", "linux/arm64"]
Expand Down

0 comments on commit 73ea594

Please sign in to comment.