wangyoucao577 commited on
Commit
d487566
·
1 Parent(s): ea8536b

fix: permissions

Browse files
Files changed (2) hide show
  1. Dockerfile +21 -4
  2. entrypoint.sh +2 -2
Dockerfile CHANGED
@@ -2,9 +2,26 @@ FROM ghcr.io/ten-framework/ten_agent_build:0.4.17
2
 
3
  RUN pip install -U "huggingface_hub[cli]"
4
 
5
- COPY .env .env
6
- COPY entrypoint.sh /entrypoint.sh
7
 
8
- WORKDIR /app
 
9
 
10
- ENTRYPOINT ["/entrypoint.sh"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  RUN pip install -U "huggingface_hub[cli]"
4
 
 
 
5
 
6
+ # Set up a new user named "user" with user ID 1000
7
+ RUN useradd -m -u 1000 user
8
 
9
+ # Switch to the "user" user
10
+ USER user
11
+
12
+ # Set home to the user's home directory
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH
15
+
16
+ # Set the working directory to the user's home directory
17
+ WORKDIR $HOME/app
18
+
19
+ # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
20
+ RUN pip install --no-cache-dir --upgrade pip
21
+
22
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
23
+ # COPY --chown=user . $HOME/app
24
+ COPY --chown=user .env $HOME/app/
25
+ COPY --chown=user entrypoint.sh $HOME/app/
26
+
27
+ ENTRYPOINT ["entrypoint.sh"]
entrypoint.sh CHANGED
@@ -1,5 +1,5 @@
1
  #!/bin/bash -xe
2
 
3
- mkdir -p /app/models
4
 
5
- HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download --resume-download Qwen/Qwen2.5-7B-Instruct --local-dir /app/models/Qwen2.5-7B-Instruct
 
1
  #!/bin/bash -xe
2
 
3
+ mkdir -p data
4
 
5
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download --resume-download Qwen/Qwen2.5-7B-Instruct --local-dir ./data/Qwen2.5-7B-Instruct