-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (31 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
45 lines (31 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# TensorFlow
FROM tensorflow/tensorflow:latest-gpu
# Environment
SHELL [ "/bin/bash", "-c" ]
# Updating the packages of the underlying operating system, and addressing privileges
# ... apt install nvidia-modprobe
# ... privileges -> https://linux.die.net/man/8/chpasswd
RUN add-apt-repository ppa:git-core/ppa && apt update && apt -y install sudo && \
apt -y install vim && apt -y install git-all && \
useradd -m algebra && echo "algebra:algebra" | chpasswd && \
adduser algebra sudo
# Hence, setting the default user ...
USER algebra
# Set application directory <app>
WORKDIR /app
# This command copies requirements.txt into /app
COPY ./requirements.txt .
# Steps:
# In this section, and relative to the <user>, (a) a /etc path is created within the user's directory, and
# ld.so.cache is created within ${HOME}/etc, next (b) the command ldconfig (linux.die.net/man/8/ldconfig) updates
# ld.so.cache, next (c) a local bin is created for pip installations, next ...
#
# Note:
# --no-cache => do not save downloads
#
RUN mkdir -p ${HOME}/etc && touch ${HOME}/etc/ld.so.cache && ldconfig -C ${HOME}/etc/ld.so.cache && \
echo "export PATH=$PATH:$HOME/.local/bin" >> ~/.bashrc && \
python -m pip install --upgrade pip && \
python -m pip install --no-cache -r requirements.txt
# Finally
CMD [ "/bin/bash" ]