forked from besarthoxhaj/mind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyBaseDockerFile
49 lines (44 loc) · 2.04 KB
/
MyBaseDockerFile
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
46
47
48
49
FROM python:3.7
USER root
RUN pip3 install jupyter
RUN pip3 install jupyterlab
RUN pip3 install pandas
RUN pip3 install matplotlib
RUN pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
RUN pip3 install opencv-python
# Instructions:
# $ docker build --file MyBaseDockerFile .
# $ docker image ls
# --tty:
# This option allocates a pseudo-TTY (terminal) for
# the container. This allows you to interact with the
# container in a terminal-like interface. Run a container
# with no options and by default you have a stdout stream
# (so docker run | <cmd> works); run with -i, and you get
# stdin stream added (so <cmd> | docker run -i works);
# use -t, usually in the combination -it and you have a
# terminal driver added, which if you are interacting with
# the process is likely what you want. It basically makes
# the container start look like a terminal connection session.
# --detach:
# This option runs the container in the background and
# detaches it from the terminal. This allows you to run
# the container without having to keep the terminal window
# open.
# --interactive:
# This option keeps the container's stdin open, which allows
# you to attach to the container and interact with it.
# --publish=8888:8888:
# This option exposes a port on the host machine and maps it
# to a port on the container. In this case, it exposes port
# 8888 on the host machine and maps it to port 8888 on the
# container. This allows you to access the container's services
# through the host machine's port 8888.
# $ docker container run --publish=8888:8888 --publish=8080:8080 --tty --detach --interactive --volume ${PWD}/volume:/test {IMAGE}
# $ docker container ls
# $ docker exec -it {CONTAINER} /bin/bash
# Then inside the docker container run:
# $ jupyter notebook --allow-root --ip=0.0.0.0
# $ jupyter lab --allow-root --ip=0.0.0.0
# Few more checks:
# !jupyter --version