-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNOTES
49 lines (33 loc) · 1.53 KB
/
NOTES
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
- Show how to read and write to a shared volume.
- Show how to run the program from host and from inside the container
- Show how the i/o data can be viewed from host and container
- show how to run unit tests locally
- show how to run the tests on travis CI
- show how to run the tests on travis CI via docker build
- show how to run in user space and apply all security features from accessing root vulnerability in docker
- show how to network into a docker container that is running a server process (flask) on a particular port
- show how to run docker siblings from docker container (with ability to share large files)
- show how to use logging within container
# Build the image
> docker build -t sample_io .
> docker images | grep sample_io
# Get into the container
> docker run -it sample_io bash
# which python
# exit
>
# Run program from host on host (must use virtual env for this in practice):
> python src/python/simple_io.py
# Run program from host on container
> docker run -w /sample_io -v $PWD/shared:/sample_io/shared sample_io
# Another more explicit way to run? [Needs fixing]
> docker run -it --rm --name simple_io -w /sample_io -v $PWD/shared:/sample_io/shared python:2 python ./python/simple_io.py
# View data from host on host:
> more shared/output.txt
# Run program from container (on container):
>
# View data from container (on container):
>
# try to access root function in docker container through code
# try to access root function after getting into container
# connect from host to a server process running inside docker