JohanDL commited on
Commit
ce35c7e
·
1 Parent(s): 427f216

Adding deps

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -10
Dockerfile CHANGED
@@ -1,30 +1,37 @@
1
  FROM continuumio/anaconda3:main
2
 
3
- # Set the working directory to /code
4
- WORKDIR /code
 
 
5
 
6
- # Copy the environment.yml file into the container
7
  COPY ./environment_docker.yml /code/environment_docker.yml
8
 
9
  # Create the environment using the environment.yml file
10
  RUN conda env create -f /code/environment_docker.yml
11
 
12
- # Copy the install_deps.sh script into the container
 
 
 
 
 
 
 
13
  COPY ./install_deps.sh /code/install_deps.sh
14
 
15
  # Make the install_deps.sh script executable
16
  RUN chmod +x /code/install_deps.sh
17
 
18
  # Run the install_deps.sh script
19
- RUN /code/install_deps.sh
20
 
21
  # Set up a new user named "user" with user ID 1000
22
  RUN useradd -m -u 1000 user
23
-
24
  # Switch to the "user" user
25
  USER user
26
-
27
- # Set home to the user's home directory and other environment variables
28
  ENV HOME=/home/user \
29
  PYTHONPATH=$HOME/app \
30
  PYTHONUNBUFFERED=1 \
@@ -37,11 +44,10 @@ ENV HOME=/home/user \
37
  # Set the working directory to the user's home directory
38
  WORKDIR $HOME/app
39
 
40
- # Copy the current directory contents into the container at $HOME/app and set the owner to the user
41
  COPY --chown=user . $HOME/app
42
 
43
  # Make run.sh executable
44
  RUN chmod +x $HOME/app/run.sh
45
 
46
- # Command to run the application
47
  CMD ["./run.sh"]
 
1
  FROM continuumio/anaconda3:main
2
 
3
+ # Install necessary system libraries
4
+ RUN apt-get update && apt-get install -y \
5
+ libgl1-mesa-glx \
6
+ libglib2.0-0
7
 
8
+ WORKDIR /code
9
  COPY ./environment_docker.yml /code/environment_docker.yml
10
 
11
  # Create the environment using the environment.yml file
12
  RUN conda env create -f /code/environment_docker.yml
13
 
14
+ # Activate the environment and install torch, torchvision, and torchaudio
15
+ RUN /opt/conda/envs/masaenv/bin/conda install -n masaenv -c pytorch -c nvidia -c conda-forge \
16
+ pytorch==2.1.2 \
17
+ torchvision==0.16.2 \
18
+ torchaudio==2.1.2 \
19
+ pytorch-cuda==11.8 \
20
+ cudatoolkit==11.8
21
+
22
  COPY ./install_deps.sh /code/install_deps.sh
23
 
24
  # Make the install_deps.sh script executable
25
  RUN chmod +x /code/install_deps.sh
26
 
27
  # Run the install_deps.sh script
28
+ RUN /bin/bash /code/install_deps.sh
29
 
30
  # Set up a new user named "user" with user ID 1000
31
  RUN useradd -m -u 1000 user
 
32
  # Switch to the "user" user
33
  USER user
34
+ # Set home to the user's home directory
 
35
  ENV HOME=/home/user \
36
  PYTHONPATH=$HOME/app \
37
  PYTHONUNBUFFERED=1 \
 
44
  # Set the working directory to the user's home directory
45
  WORKDIR $HOME/app
46
 
47
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
48
  COPY --chown=user . $HOME/app
49
 
50
  # Make run.sh executable
51
  RUN chmod +x $HOME/app/run.sh
52
 
 
53
  CMD ["./run.sh"]