Skip to content

Commit a761948

Browse files
committed
fix(wip): Update secrets mount to actually work
1 parent 4a86c60 commit a761948

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

Dockerfile.agentic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ USER "${USER_NAME}"
5252
# && curl -LsSf https://hf.co/cli/install.sh | bash \
5353
# && /tmp/scripts/build_llama_cpp_from_source.sh \
5454
# && hf download "${HF_REPO}" --local-dir "${MODEL_DIRECTORY}" --token "${HF_API_TOKEN}"
55-
RUN --mount=type=secret,id=HF_API_TOKEN \
55+
RUN --mount=type=secret,id=HF_API_TOKEN,env=HF_API_TOKEN \
5656
mkdir -p "${MODEL_DIRECTORY}" && chmod 777 "${MODEL_DIRECTORY}" \
5757
&& eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
5858
&& brew install --force hf llama.cpp \

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ terminal-image:
4040
notebook-image:
4141
@$(MAKE) IMAGE=notebook --no-print-directory build-image
4242
agentic-image:
43-
@$(MAKE) IMAGE=agentic --no-print-directory build-image
43+
@$(MAKE) IMAGE=agentic DOCKER_BUILD_SECRETS="--secret id=HF_API_TOKEN,env=HF_API_TOKEN" --no-print-directory build-image
4444
#
4545
# Push tasks
4646
#
@@ -56,12 +56,13 @@ push-agentic:
5656
# Parameterized tasks
5757
#
5858
DOCKERFILE ?= ./Dockerfile.${IMAGE}
59+
DOCKER_BUILD_SECRETS ?=
5960
build-image:
60-
@docker build \
61+
@HF_API_TOKEN="$(HF_API_TOKEN)" docker build \
6162
--no-cache \
6263
--build-arg VERSION=$(VERSION) \
6364
--file ${DOCKERFILE} \
64-
--secret id=HF_API_TOKEN \
65+
${DOCKER_BUILD_SECRETS} \
6566
--tag ${REGISTRY}/${GITHUB_ACTOR}/${IMAGE}:$(VERSION) \
6667
.
6768
@docker tag ${REGISTRY}/${GITHUB_ACTOR}/${IMAGE}:$(VERSION) ${REGISTRY}/${GITHUB_ACTOR}/${IMAGE}:latest

0 commit comments

Comments
 (0)