Skip to content

BrainAPI is a knowledge graph–powered AI memory layer that transforms unstructured data into structured knowledge, enabling intelligent search, recommendations, and contextual memory for AI agents and applications.

Remove image security advisories

Christian53e123080522
diff --git a/Dockerfile b/Dockerfile
index 99f955c..d3c941c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -74,14 +74,12 @@ ENV PYTHONUNBUFFERED=1 \
PIP_TIMEOUT=900 \
PIP_DEFAULT_TIMEOUT=900
-RUN apt-get update && apt-get install -y --no-install-recommends \
+RUN apt-get update && apt-get upgrade -y \
+ && apt-get install -y --no-install-recommends \
curl \
+ util-linux \
&& rm -rf /var/lib/apt/lists/* \
- && GOSU_VERSION=1.19 \
- && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
- && curl -fsSL -o /usr/local/bin/gosu \
- "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${dpkgArch}" \
- && chmod +x /usr/local/bin/gosu \
+ && python -m pip uninstall -y setuptools wheel \
&& groupadd -r appuser && useradd -r -g appuser -m appuser
WORKDIR /app
diff --git a/entrypoint.sh b/entrypoint.sh
index bc621ea..cea3e35 100644
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -29,7 +29,8 @@ if [ -n "$BRAINAPI_PLUGINS" ]; then
version="${plugin_spec##*:}"
[ "$name" = "$version" ] && version="latest"
echo "[brainapi] Installing plugin: $name v$version"
- if ! gosu appuser /app/.venv/bin/python -m src.core.plugins.cli plugins install "$name" --version "$version"; then
+ if ! setpriv --reuid=appuser --regid=appuser --init-groups -- \
+ /app/.venv/bin/python -m src.core.plugins.cli plugins install "$name" --version "$version"; then
if [ "$plugin_failure_policy" = "fail" ]; then
echo "[brainapi] Failed to install required plugin '$name'" >&2
exit 1
@@ -39,4 +40,5 @@ if [ -n "$BRAINAPI_PLUGINS" ]; then
done
fi
-exec gosu appuser /app/.venv/bin/python "$@"
+exec setpriv --reuid=appuser --regid=appuser --init-groups -- \
+ /app/.venv/bin/python "$@"