check ubuntu user and set uv python dir (#3492)
This commit is contained in:
@@ -47,6 +47,14 @@ COPY .axolotl-complete.bash /home/ubuntu/.axolotl-complete.bash
|
||||
RUN chmod +x /home/ubuntu/.axolotl-complete.bash && \
|
||||
echo 'source /home/ubuntu/.axolotl-complete.bash' >> /home/ubuntu/.bashrc
|
||||
|
||||
# Ensure ubuntu user exists (may already exist from base image)
|
||||
RUN id ubuntu &>/dev/null || ( \
|
||||
useradd -m -s /bin/bash -u 1000 ubuntu && \
|
||||
apt-get update && apt-get install -y --no-install-recommends sudo && rm -rf /var/lib/apt/lists/* \
|
||||
); \
|
||||
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu && \
|
||||
chmod 0440 /etc/sudoers.d/ubuntu
|
||||
|
||||
RUN chown -R ubuntu:ubuntu /workspace /home/ubuntu
|
||||
|
||||
USER ubuntu
|
||||
|
||||
@@ -27,7 +27,9 @@ RUN useradd -m -s /bin/bash -u 1000 ubuntu 2>/dev/null; \
|
||||
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu && \
|
||||
chmod 0440 /etc/sudoers.d/ubuntu
|
||||
|
||||
RUN uv python install ${PYTHON_VERSION}
|
||||
ENV UV_PYTHON_INSTALL_DIR="/opt/uv/python"
|
||||
RUN uv python install ${PYTHON_VERSION} && \
|
||||
chmod -R a+rX /opt/uv
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user