mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-12 15:45:00 +00:00
feat(docker): add permissions kludges to support docker run --user xxx
The changes in this commit add some permission kludges to the Docker image to support running the container with the `--user` flag. Specifically, it: - Adds permissions to the virtual environment directory and subdirectories to allow read/write/execute access for all users. - Creates the `.aider` and `.cache` directories and grants read/write/execute access to all users. This ensures that the container can be run with a non-root user without encountering permission issues.
This commit is contained in:
parent
67c4df09fd
commit
711ca9df08
1 changed files with 10 additions and 4 deletions
|
@ -9,6 +9,12 @@ WORKDIR /app
|
|||
RUN python -m venv /venv
|
||||
ENV PATH="/venv/bin:$PATH"
|
||||
|
||||
# Permission kludges to support `docker run --user xxx`
|
||||
RUN chmod a+rwx /venv /venv/{bin,include,lib,lib/python3.1/site-packages}
|
||||
|
||||
RUN mkdir /.aider /.cache
|
||||
RUN chmod a+rwx /.aider /.cache
|
||||
|
||||
# So git doesn't complain about unusual permissions
|
||||
RUN git config --system --add safe.directory /app
|
||||
|
||||
|
@ -16,8 +22,8 @@ RUN git config --system --add safe.directory /app
|
|||
FROM base AS aider-full
|
||||
|
||||
COPY . /tmp/aider
|
||||
RUN pip install --upgrade pip \
|
||||
&& pip install --no-cache-dir /tmp/aider[help,browser,playwright] \
|
||||
RUN /venv/bin/python -m pip install --upgrade --no-cache-dir pip \
|
||||
&& /venv/bin/python -m pip install --no-cache-dir /tmp/aider[help,browser,playwright] \
|
||||
--extra-index-url https://download.pytorch.org/whl/cpu \
|
||||
&& rm -rf /tmp/aider
|
||||
|
||||
|
@ -29,8 +35,8 @@ ENTRYPOINT ["/venv/bin/aider"]
|
|||
FROM base AS aider
|
||||
|
||||
COPY . /tmp/aider
|
||||
RUN pip install --upgrade pip \
|
||||
&& pip install --no-cache-dir /tmp/aider \
|
||||
RUN /venv/bin/python -m pip install --upgrade --no-cache-dir pip \
|
||||
&& /venv/bin/python -m pip install --no-cache-dir /tmp/aider \
|
||||
--extra-index-url https://download.pytorch.org/whl/cpu \
|
||||
&& rm -rf /tmp/aider
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue