Skip to content

Commit b9f0f95

Browse files
committed
.
1 parent 4c254e8 commit b9f0f95

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

docker.rst

+26-4
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,51 @@ Each layer is cached, such that when any layer fails and is fixed, rebuilding it
6161
EXPOSE 5555
6262
6363
# run the following command when docker is run
64-
CMD python server.py
64+
# -u so prints in code appear in cmd
65+
CMD python -u server.py
6566
6667
6768
Environment Variable
6869
*********************
6970

70-
To pass environment variables from ``docker run`` to the python code, we can use ``os.environ.get``.
71+
To pass environment variables from ``docker run`` to the python code, we can use two methods.
72+
73+
**1) Using ``os.environ.get`` in python script**
7174

7275
.. code:: python
7376
7477
import os
7578
ip_address = os.environ.get('webcam_ip')
7679
77-
Then specify in docker run the variable for user input, followed by the image name
80+
Then specify in ``docker run`` the variable for user input, followed by the image name
7881

7982
.. code:: bash
83+
# in Dockerfile
84+
CMD python -u main.py
8085
86+
# in bash
8187
docker run -e webcam_ip=192.168.133.1 image_name
8288
8389
90+
**2) Using ``ENTRYPOINT`` in Dockerfile**
91+
92+
.. code:: python
93+
94+
webcam_ip = str(sys.argv[1])
95+
96+
.. code:: bash
97+
98+
ENTRYPOINT [ "python", "-u", "main.py" ]
99+
100+
101+
84102
Build the Image
85103
*******************
86-
``docker build -t imageName:tagName .`` --(-t = tag the image as) build and name image, "." as current directory to look for Dockerfile
104+
``docker build -t imageName .`` --(-t = tag the image as) build and name image, "." as current directory to look for Dockerfile
105+
106+
Note that everytime you rebuild an image with the same name, the previous image will have their image name & tag
107+
displayed as `<None>`.
108+
87109

88110
Push to Dockerhub
89111
********************

evaluation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ Confusion Matrix
3535
https://www.youtube.com/watch?v=21Igj5Pr6u4
3636

3737

38-
**Recall|Sensitivity**: (True Positive / True Positive + False Negative) High recall means to get all
38+
**Recall|Sensitivity**: (True Positive / [True Positive + False Negative]) High recall means to get all
3939
positives (i.e., True Positive + False Negative) despite having some false positives.
4040
Search & extraction in legal cases, Tumour detection. Often need humans to filter false positives.
4141

42-
**Precision**: (True Positive / True Positive + False Positive) High precision means it is important
42+
**Precision**: (True Positive / [True Positive + False Positive]) High precision means it is important
4343
to filter off the any false positives.
4444
Search query suggestion, Document classification, customer-facing tasks.
4545

0 commit comments

Comments
 (0)