mattb512 commited on
Commit
3567bb7
1 Parent(s): a747462

run docker as specific user

Browse files
Files changed (2) hide show
  1. Dockerfile +12 -3
  2. startup.sh +7 -3
Dockerfile CHANGED
@@ -16,10 +16,19 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86
16
 
17
  # Put conda in path so we can use conda activate
18
  ENV PATH=$CONDA_DIR/bin:$PATH
19
-
20
  RUN conda install --yes pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
21
 
22
- COPY . .
 
 
 
 
 
 
 
 
 
 
23
 
24
  RUN git clone https://github.com/TRI-ML/vlm-evaluation.git
25
 
@@ -27,4 +36,4 @@ RUN cd vlm-evaluation && pip install -e .
27
 
28
  RUN pip install -e .
29
 
30
- CMD ["sh", "/code/startup.sh"]
 
16
 
17
  # Put conda in path so we can use conda activate
18
  ENV PATH=$CONDA_DIR/bin:$PATH
 
19
  RUN conda install --yes pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
20
 
21
+ # User setup
22
+ RUN useradd -m -u 1000 user
23
+
24
+ USER user
25
+
26
+ ENV HOME=/home/user \
27
+ PATH=/home/user/.local/bin:$PATH
28
+
29
+ WORKDIR $HOME/app
30
+
31
+ COPY --chown=user . $HOME/app
32
 
33
  RUN git clone https://github.com/TRI-ML/vlm-evaluation.git
34
 
 
36
 
37
  RUN pip install -e .
38
 
39
+ CMD ["sh", "/app/startup.sh"]
startup.sh CHANGED
@@ -8,9 +8,13 @@ P2=$!
8
  sleep 30
9
  echo "PWD:"
10
  pwd
11
- echo $TEST_SECRET
12
- evho "env:"
13
- echo $(env)
 
 
 
 
14
  echo $HF_TOKEN > .hf_token
15
  python -m interactive_demo --port 40000 --model_id prism-dinosiglip+7b
16
  python -m interactive_demo --port 40001 --model_family llava-v15 --model_id llava-v1.5-7b --model_dir liuhaotian/llava-v1.5-7b
 
8
  sleep 30
9
  echo "PWD:"
10
  pwd
11
+ echo "LS:"
12
+ ls -als
13
+
14
+ echo "TEST SECRET: $TEST_SECRET"
15
+
16
+ echo "ENV: $(env)"
17
+
18
  echo $HF_TOKEN > .hf_token
19
  python -m interactive_demo --port 40000 --model_id prism-dinosiglip+7b
20
  python -m interactive_demo --port 40001 --model_family llava-v15 --model_id llava-v1.5-7b --model_dir liuhaotian/llava-v1.5-7b