Skip to content

Commit eac2861

Browse files
ralphbeantsorya
authored andcommitted
Pull instructlab image with auth, if provided
Upstream, this image can be pulled unauthenticated, but in other environments a user might want to include an image that exists in some repository that requires authentication to pull. The person building the image needs to provide `--secret=id=instructlab-nvidia-pull/.dockerconfigjson,src=instructlab-nvidia-pull/.dockerconfigjson` when building the image in order to make the secret available. Signed-off-by: Ralph Bean <rbean@redhat.com>
1 parent b50e5de commit eac2861

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

training/nvidia-bootc/Containerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,12 @@ RUN for i in /usr/local/bin/ilab*; do \
182182
# Added for running as an OCI Container to prevent Overlay on Overlay issues.
183183
VOLUME /var/lib/containers
184184

185-
RUN if [ -f "/run/.input/instructlab-nvidia/oci-layout" ]; then \
185+
RUN --mount=type=secret,id=instructlab-nvidia-pull/.dockerconfigjson \
186+
if [ -f "/run/.input/instructlab-nvidia/oci-layout" ]; then \
186187
IID=$(podman --root /usr/lib/containers/storage pull oci:/run/.input/instructlab-nvidia) && \
187188
podman --root /usr/lib/containers/storage image tag ${IID} ${INSTRUCTLAB_IMAGE}; \
189+
elif [ -f "/run/secrets/instructlab-nvidia-pull/.dockerconfigjson" ]; then \
190+
IID=$(sudo podman --root /usr/lib/containers/storage pull --authfile /run/secrets/instructlab-nvidia-pull/.dockerconfigjson ${INSTRUCTLAB_IMAGE}); \
188191
else \
189192
IID=$(sudo podman --root /usr/lib/containers/storage pull ${INSTRUCTLAB_IMAGE}); \
190193
fi

0 commit comments

Comments
 (0)