🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
Run containers as non-root with host UID/GID mapping (#3127)
Aravindan M21bf11ec3453
diff --git a/.container/Dockerfile b/.container/Dockerfileindex 3b6b0eb08..f29d04604 100644--- a/.container/Dockerfile+++ b/.container/Dockerfile@@ -1,9 +1,11 @@FROM python:3.10-bookwormRUN pip install uv+RUN groupadd -r appuser && useradd -r -g appuser appuserWORKDIR /app/camelCOPY . .+RUN chown -R appuser:appuser /app/camelRUN uv venv .venv --python=3.10 && \. .venv/bin/activate && \@@ -14,4 +16,6 @@ RUN uv venv .venv --python=3.10 && \ENV VIRTUAL_ENV=/app/camel/.venvENV PATH="$VIRTUAL_ENV/bin:$PATH"+USER appuser+CMD ["bash"]diff --git a/.container/docker-compose.yaml b/.container/docker-compose.yamlindex b63199399..dd02a19a6 100644--- a/.container/docker-compose.yaml+++ b/.container/docker-compose.yaml@@ -9,4 +9,7 @@ services:- ../:/app/camelenv_file:- .env+ user: "${UID:-1000}:${GID:-1000}"command: ["tail", "-f", "/dev/null"]++diff --git a/.container/minimal_build/Dockerfile b/.container/minimal_build/Dockerfileindex f7aa652fb..9c3cf4854 100644--- a/.container/minimal_build/Dockerfile+++ b/.container/minimal_build/Dockerfile@@ -1,16 +1,17 @@FROM python:3.10-bookworm-# Install uvRUN pip install uv+RUN groupadd -r appuser && useradd -r -g appuser appuserCOPY . /app/camel-WORKDIR /app/camel+RUN chown -R appuser:appuser /app/camel-# Setup virtual environment and install dependenciesRUN uv venv .venv --python=3.10 && \. .venv/bin/activate && \uv pip install -e ".[all, dev, docs]" && \pip install pre-commit mypy-CMD ["tail", "-f", "/dev/null"]\ No newline at end of file+USER appuser++CMD ["tail", "-f", "/dev/null"]diff --git a/camel/interpreters/docker/Dockerfile b/camel/interpreters/docker/Dockerfileindex c2ccfefe7..8a3862f37 100644--- a/camel/interpreters/docker/Dockerfile+++ b/camel/interpreters/docker/Dockerfile@@ -1,11 +1,8 @@# syntax=docker/dockerfile:1-FROM ubuntu:22.04-# Set environment variable to avoid interactive promptsENV DEBIAN_FRONTEND=noninteractive-# Update and install base utilitiesRUN apt-get update && apt-get install -y \build-essential \software-properties-common \@@ -20,7 +17,6 @@ RUN apt-get update && apt-get install -y \&& apt-get clean \&& apt-get autoremove -y-# Install Python 3.10 and its dependenciesRUN add-apt-repository ppa:deadsnakes/ppa && \apt-get update && \apt-get install -y \@@ -34,32 +30,27 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \&& apt-get clean \&& apt-get autoremove -y-# Install RRUN apt-get update && \apt-get install -y r-base && \rm -rf /var/lib/apt/lists/* && \apt-get clean && \apt-get autoremove -y-# Install NodeJS 22.xRUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \apt-get install -y nodejs && \rm -rf /var/lib/apt/lists/* && \apt-get clean && \apt-get autoremove -y-# Install PoetryRUN curl -fsSL https://install.python-poetry.org | python3.10 - && \ln -s ~/.local/bin/poetry /usr/local/bin/poetry-# Upgrade pip and install base Python packagesRUN python3.10 -m pip install --upgrade pip setuptools wheel--# Install uv using pip instead of the shell scriptRUN pip install uv-# Setup working directory+RUN groupadd -r devuser && useradd -r -m -g devuser devuserWORKDIR /workspace+RUN chown -R devuser:devuser /workspace+USER devuser-# Set default shellCMD ["/bin/bash"]