File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change
1
+ # Build arguments declared in the global scope.
1
2
ARG ANSIBLE_CHATBOT_BASE_IMAGE=ansible-chatbot-stack-base
3
+ ARG ANSIBLE_CHATBOT_VERSION=latest
2
4
ARG LLAMA_STACK_VERSION=0.2.9
3
5
4
6
FROM ${ANSIBLE_CHATBOT_BASE_IMAGE}:${LLAMA_STACK_VERSION}
5
7
8
+ # Re-declaring arguments without a value, inherits the global default one.
9
+ ARG ANSIBLE_CHATBOT_VERSION
6
10
ENV LLAMA_STACK_CONFIG_DIR=/.llama/data
7
11
8
12
# Data and configuration
9
13
RUN mkdir -p /.llama/distributions/ansible-chatbot
10
14
RUN mkdir -p /.llama/data/distributions/ansible-chatbot
11
15
ADD ansible-chatbot-run.yaml /.llama/distributions/ansible-chatbot
16
+ RUN echo -e "\
17
+ {\n \
18
+ \" version\" : \" ${ANSIBLE_CHATBOT_VERSION}\" \n \
19
+ }\n \
20
+ " > /.llama/distributions/ansible-chatbot/ansible-chatbot-version-info.json
12
21
RUN chmod -R g+rw /.llama
13
22
14
23
# Bootstrap
Original file line number Diff line number Diff line change @@ -89,9 +89,11 @@ check-env-build-custom:
89
89
exit 1; \
90
90
fi
91
91
92
- build-custom : check-env-build-custom build
92
+ build-custom : check-env-build-custom
93
93
@echo " Building customized Ansible Chatbot Stack image..."
94
- docker build -f Containerfile -t ansible-chatbot-stack:$(ANSIBLE_CHATBOT_VERSION ) --build-arg LLAMA_STACK_VERSION=$(LLAMA_STACK_VERSION ) .
94
+ docker build -f Containerfile -t ansible-chatbot-stack:$(ANSIBLE_CHATBOT_VERSION ) \
95
+ --build-arg ANSIBLE_CHATBOT_VERSION=$(ANSIBLE_CHATBOT_VERSION ) \
96
+ --build-arg LLAMA_STACK_VERSION=$(LLAMA_STACK_VERSION ) .
95
97
@printf " Custom image $( RED) ansible-chatbot-stack:$( ANSIBLE_CHATBOT_VERSION) $( NC) built successfully.\n"
96
98
97
99
# Pre-check required environment variables for build-lsc
@@ -103,7 +105,9 @@ check-env-build-lsc:
103
105
104
106
build-lsc : check-env-build-lsc
105
107
@echo " Building customized Ansible Chatbot Stack image from lightspeed-core/lightspeed-stack..."
106
- docker build -f ./lightspeed-stack/Containerfile.lsc -t ansible-chatbot-stack:$(ANSIBLE_CHATBOT_VERSION ) .
108
+ docker build -f ./lightspeed-stack/Containerfile.lsc \
109
+ --build-arg ANSIBLE_CHATBOT_VERSION=$(ANSIBLE_CHATBOT_VERSION ) \
110
+ -t ansible-chatbot-stack:$(ANSIBLE_CHATBOT_VERSION ) .
107
111
@printf " Custom image $( RED) ansible-chatbot-stack:$( ANSIBLE_CHATBOT_VERSION) $( NC) built successfully.\n"
108
112
109
113
# Pre-check for required environment variables
Original file line number Diff line number Diff line change
1
+ # Build arguments declared in the global scope.
2
+ ARG ANSIBLE_CHATBOT_VERSION=latest
3
+
1
4
# ======================================================
2
5
# Transient image to construct Python venv
3
6
# ------------------------------------------------------
@@ -30,6 +33,8 @@ FROM quay.io/lightspeed-core/lightspeed-stack:latest
30
33
31
34
USER 0
32
35
36
+ # Re-declaring arguments without a value, inherits the global default one.
37
+ ARG ANSIBLE_CHATBOT_VERSION
33
38
ARG APP_ROOT=/app-root
34
39
RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs python3.11
35
40
WORKDIR /app-root
@@ -58,6 +63,11 @@ ENV LLAMA_STACK_CONFIG_DIR=/.llama/data
58
63
RUN mkdir -p /.llama/distributions/ansible-chatbot
59
64
RUN mkdir -p /.llama/data/distributions/ansible-chatbot
60
65
ADD ansible-chatbot-run.yaml /.llama/distributions/ansible-chatbot
66
+ RUN echo -e "\
67
+ {\n\
68
+ \"version\": \"${ANSIBLE_CHATBOT_VERSION}\" \n\
69
+ }\n\
70
+ " > /.llama/distributions/ansible-chatbot/ansible-chatbot-version-info.json
61
71
ADD llama-stack/providers.d /.llama/providers.d
62
72
RUN chmod -R g+rw /.llama
63
73
You can’t perform that action at this time.
0 commit comments