Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +21 -0
Dockerfile
CHANGED
@@ -9,7 +9,28 @@ ARG GPU_CHOICE=A
|
|
9 |
ARG USE_CUDA118=FALSE
|
10 |
ARG LAUNCH_AFTER_INSTALL=FALSE
|
11 |
ARG INSTALL_EXTENSIONS=TRUE
|
|
|
|
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,rw \
|
14 |
apt update && \
|
15 |
apt install --no-install-recommends -y git vim build-essential python3-dev pip bash curl && \
|
|
|
9 |
ARG USE_CUDA118=FALSE
|
10 |
ARG LAUNCH_AFTER_INSTALL=FALSE
|
11 |
ARG INSTALL_EXTENSIONS=TRUE
|
12 |
+
# Set up a new user named "user" with user ID 1000
|
13 |
+
RUN useradd -m -u 1000 user
|
14 |
|
15 |
+
# Switch to the "user" user
|
16 |
+
USER user
|
17 |
+
|
18 |
+
# Set home to the user's home directory
|
19 |
+
ENV HOME=/home/user \
|
20 |
+
PATH=/home/user/.local/bin:$PATH
|
21 |
+
|
22 |
+
# Set the working directory to the user's home directory
|
23 |
+
WORKDIR $HOME/app
|
24 |
+
|
25 |
+
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
26 |
+
RUN pip install --no-cache-dir --upgrade pip
|
27 |
+
|
28 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
29 |
+
COPY --chown=user . $HOME/app
|
30 |
+
|
31 |
+
# Download a checkpoint
|
32 |
+
RUN mkdir content
|
33 |
+
ADD --chown=user https://<SOME_ASSET_URL> content/<SOME_ASSET_NAME>
|
34 |
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,rw \
|
35 |
apt update && \
|
36 |
apt install --no-install-recommends -y git vim build-essential python3-dev pip bash curl && \
|