chris10 commited on
Commit
2276a68
1 Parent(s): 53644dc

updated Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -3
Dockerfile CHANGED
@@ -2,15 +2,26 @@ FROM ubuntu:22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
- WORKDIR /code
6
-
7
  RUN apt-get update && apt-get install -y python3 python3-pip cmake python3-pybind11 libeigen3-dev python3-opencv \
8
  libopencv-dev libboost-all-dev git libglfw3-dev libosmesa6-dev libgl1-mesa-dev wget mesa-utils vim \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  RUN pip3 install --no-cache-dir torch==2.1.2+cpu torchvision==0.16.2+cpu torchaudio==2.1.2+cpu --index-url https://download.pytorch.org/whl/cpu
12
 
13
- COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  RUN pip3 install --no-cache-dir -r requirements.txt
15
 
16
 
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
 
 
5
  RUN apt-get update && apt-get install -y python3 python3-pip cmake python3-pybind11 libeigen3-dev python3-opencv \
6
  libopencv-dev libboost-all-dev git libglfw3-dev libosmesa6-dev libgl1-mesa-dev wget mesa-utils vim \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  RUN pip3 install --no-cache-dir torch==2.1.2+cpu torchvision==0.16.2+cpu torchaudio==2.1.2+cpu --index-url https://download.pytorch.org/whl/cpu
10
 
11
+ # Set up a new user named "user" with user ID 1000
12
+ RUN useradd -m -u 1000 user
13
+ # Switch to the "user" user
14
+ USER user
15
+ # Set home to the user's home directory
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH
18
+
19
+ # Set the working directory to the user's home directory
20
+ WORKDIR $HOME/app
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
+
25
  RUN pip3 install --no-cache-dir -r requirements.txt
26
 
27