Skip to content

Commit e6df5ce

Browse files
committed
Add shellcheck to validate bash
Help to avoid bugs Signed-off-by: Eric Curtin <eric.curtin@docker.com>
1 parent 3886d0f commit e6df5ce

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ ARG LLAMA_SERVER_VARIANT
4040
# Create non-root user
4141
RUN groupadd --system modelrunner && useradd --system --gid modelrunner --create-home --home-dir /home/modelrunner modelrunner
4242

43+
COPY scripts/apt-install.sh apt-install.sh
44+
45+
# Install ca-certificates for HTTPS and vulkan
46+
RUN ./apt-install.sh
47+
4348
# Install ca-certificates for HTTPS and vulkan
4449
RUN apt-get update && \
4550
packages="ca-certificates" && \

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MODELS_PATH := $(shell pwd)/models-store
1010
LLAMA_ARGS ?=
1111

1212
# Main targets
13-
.PHONY: build run clean test docker-build docker-run help
13+
.PHONY: build run clean test docker-build docker-run help validate
1414

1515
# Default target
1616
.DEFAULT_GOAL := help
@@ -34,6 +34,9 @@ clean:
3434
test:
3535
go test -v ./...
3636

37+
validate:
38+
find . -name '*.sh' -exec shellcheck {} +
39+
3740
# Build Docker image
3841
docker-build:
3942
docker buildx build \

scripts/apt-install.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
main() {
4+
set -eux -o pipefail
5+
6+
apt-get update
7+
local packages=("ca-certificates")
8+
if [ "${LLAMA_SERVER_VARIANT}" = "generic" ] || [ "${LLAMA_SERVER_VARIANT}" = "cpu" ]; then
9+
packages+=("libvulkan1")
10+
fi
11+
12+
apt-get install -y --no-install-recommends "${packages[@]}"
13+
rm -rf /var/lib/apt/lists/*
14+
}
15+
16+
main "$@"
17+

0 commit comments

Comments
 (0)