/l3/users/slm/2018-12-minsk-aws/student03.BigClassRoom/user :1 :2 :3 :4 :5 :6 :7 |
|
$ls -la
total 36 drwxr-xr-x 2 user user 4096 Dec 21 10:42 . drwxr-xr-x 25 user user 4096 Dec 21 15:32 .. -rw------- 1 user user 29 Dec 19 14:28 config -rw------- 1 user user 116 Dec 19 14:28 credentials -rw-r--r-- 1 user user 127 Dec 21 10:33 cr.txt -rw-r--r-- 1 user user 13380 Dec 21 10:42 get-docker.sh |
$more config
|
$more credentials
|
$more get-docker.sh
|
$cd ..
|
$ls -la
total 179316 drwxr-xr-x 25 user user 4096 Dec 21 15:32 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 2 user user 4096 Dec 21 10:42 .aws drwxr-xr-x 4 user user 4096 Dec 20 15:46 AWS -rw------- 1 user user 12882 Dec 21 15:32 .bash_history -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 666 Dec 19 14:41 .bashrc drwx------ 11 user user 4096 Dec 21 14:53 .cache ... -rw-r--r-- 1 user user 4109 Dec 19 15:04 .saws.log -rw-r--r-- 1 user user 596 Dec 19 17:05 .sawsrc -rw-r--r-- 1 user user 2256 Dec 19 14:49 .saws.shortcuts drwx------ 2 user user 4096 Dec 19 11:33 .ssh -rw------- 1 user user 12288 Dec 19 11:19 .tatyanaDNS.txt.swp -rw-r--r-- 1 user user 1796 Dec 20 11:48 teacher_script_1.txt drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 14049 Dec 21 10:33 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$cd .ssh/
|
$ls -la
total 32 drwx------ 2 user user 4096 Dec 19 11:33 . drwxr-xr-x 25 user user 4096 Dec 21 15:32 .. -rw-r--r-- 1 user user 168 Dec 19 11:33 config -rw------- 1 user user 1766 Dec 19 10:45 id_rsa -rw-r--r-- 1 user user 389 Dec 19 10:45 id_rsa.pub -rw-r--r-- 1 user user 3330 Dec 20 12:17 known_hosts -rw-r--r-- 1 user user 389 Dec 19 11:01 m2_id_rsa.pub -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
$more config
|
$cd AWS/
|
$mkdir docker
|
$cd docker/
|
$mkdir qrencode
|
$cd qrencode/
|
$vim Dockerfile
![]() |
$vim Dockerfile
|
$ls -la
total 12 drwxr-xr-x 2 user user 4096 Dec 21 15:56 . drwxr-xr-x 3 user user 4096 Dec 21 15:49 .. -rw-r--r-- 1 user user 144 Dec 21 15:56 Dockerfile |
$docker build
![]() "docker build" requires exactly 1 argument. See 'docker build --help'. Usage: docker build [OPTIONS] PATH | URL | - Build an image from a Dockerfile |
$vim Dockerfile
|
$vim Dockerfile
|
$docker build.
![]() docker: 'build.' is not a docker command. See 'docker --help' |
$docker built.
![]() docker: 'built.' is not a docker command. See 'docker --help' |
$docker build .
![]() Sending build context to Docker daemon 2.048kB Step 1/7 : FROM debian:8 8: Pulling from library/debian 4b105072aa89: Pull complete Digest: sha256:14e15b63bf3c26dac4f6e782dbb4c9877fb88d7d5978d202cb64065b1e01a88b Status: Downloaded newer image for debian:8 ---> 39db55273026 Step 2/7 : RUN apt-get update ---> Running in 095bc50b398b Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB] Ign http://deb.debian.org jessie InRelease Get:2 http://deb.debian.org jessie-updates InRelease [145 kB] Get:3 http://deb.debian.org jessie Release.gpg [2420 B] Get:4 http://deb.debian.org jessie Release [148 kB] Get:5 http://security.debian.org jessie/updates/main amd64 Packages [782 kB] Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [23.0 kB] Get:7 http://deb.debian.org jessie/main amd64 Packages [9098 kB] ^C |
$docker build .
![]() Sending build context to Docker daemon 2.048kB Step 1/7 : FROM debian:8 ---> 39db55273026 Step 2/7 : RUN apt-get update ---> Running in 4828f3e8b083 Ign http://deb.debian.org jessie InRelease Get:1 http://deb.debian.org jessie-updates InRelease [145 kB] Get:2 http://security.debian.org jessie/updates InRelease [44.9 kB] Get:3 http://deb.debian.org jessie Release.gpg [2420 B] Get:4 http://deb.debian.org jessie Release [148 kB] ... Also creating executable in ve/bin/python Installing setuptools, pip...done. Running virtualenv with interpreter /usr/bin/python2 Removing intermediate container 4fc7530f8e48 ---> 07d6cec1a65d Step 7/7 : RUN ve/bin/pip install -r requirements.txt ---> Running in cc36c74e3ddb Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt' Storing debug log for failure in /root/.pip/pip.log The command '/bin/sh -c ve/bin/pip install -r requirements.txt' returned a non-zero code: 1 |
$cd AWS/docker/qrencode/
|
$ls -la
total 12 drwxr-xr-x 2 user user 4096 Dec 21 15:57 . drwxr-xr-x 3 user user 4096 Dec 21 15:49 .. -rw-r--r-- 1 user user 213 Dec 21 15:57 Dockerfile |
$more Dockerfile
|
$vi Dockerfile
|
$docker build .
![]() Sending build context to Docker daemon 2.048kB Step 1/6 : FROM debian:8 ---> 39db55273026 Step 2/6 : RUN apt-get update ---> Using cache ---> 25505e0c19f0 Step 3/6 : RUN apt-get install -y git-core python-virtualenv ---> Using cache ---> b9b1fd616825 Step 4/6 : RUN git clone https://github.com/chubin/qrenco.de ... File "/qrenco.de/ve/local/lib/python2.7/site-packages/pkg_resources.py", line 2721, in parse_requirements "version spec") File "/qrenco.de/ve/local/lib/python2.7/site-packages/pkg_resources.py", line 2697, in scan_list raise ValueError(msg, line, "at", line[p:]) ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'") ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-RT_1xn/gevent Storing debug log for failure in /root/.pip/pip.log The command '/bin/sh -c cd qrenco.de && ve/bin/pip install -r requirements.txt' returned a non-zero code: 1 |
$docker build .
![]() Sending build context to Docker daemon 2.048kB Step 1/6 : FROM debian:8 ---> 39db55273026 Step 2/6 : RUN apt-get update ---> Using cache ---> 25505e0c19f0 Step 3/6 : RUN apt-get install -y git-core python-virtualenv ---> Using cache ---> b9b1fd616825 Step 4/6 : RUN git clone https://github.com/chubin/qrenco.de ... File "/qrenco.de/ve/local/lib/python2.7/site-packages/pkg_resources.py", line 2721, in parse_requirements "version spec") File "/qrenco.de/ve/local/lib/python2.7/site-packages/pkg_resources.py", line 2697, in scan_list raise ValueError(msg, line, "at", line[p:]) ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'") ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-Bi2MfY/gevent Storing debug log for failure in /root/.pip/pip.log The command '/bin/sh -c cd qrenco.de && ve/bin/pip install -r requirements.txt' returned a non-zero code: 1 |
$docker build .
![]() Sending build context to Docker daemon 14.85kB Step 1/6 : FROM debian:8 ---> 39db55273026 Step 2/6 : RUN apt-get update ---> Using cache ---> 25505e0c19f0 Step 3/6 : RUN apt-get install -y git-core python-virtualenv ---> Using cache ---> b9b1fd616825 Step 4/6 : RUN git clone https://github.com/chubin/qrenco.de ... File "/qrenco.de/ve/local/lib/python2.7/site-packages/pkg_resources.py", line 2721, in parse_requirements "version spec") File "/qrenco.de/ve/local/lib/python2.7/site-packages/pkg_resources.py", line 2697, in scan_list raise ValueError(msg, line, "at", line[p:]) ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'") ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-f8tZoU/gevent Storing debug log for failure in /root/.pip/pip.log The command '/bin/sh -c cd qrenco.de && ve/bin/pip install -r requirements.txt' returned a non-zero code: 1 |
$docker built .
![]() docker: 'built' is not a docker command. See 'docker --help' |
$docker build .
Sending build context to Docker daemon 2.048kB Step 1/6 : FROM debian:9 9: Pulling from library/debian Digest: sha256:df6ebd5e9c87d0d7381360209f3a05c62981b5c2a3ec94228da4082ba07c4f05 Status: Downloaded newer image for debian:9 ---> 4879790bd60d Step 2/6 : RUN apt-get update ---> Running in 81a861cbd5b9 Get:1 http://security-cdn.debian.org/debian-security stretch/updates InRelease [94.3 kB] Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease ... Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB) Collecting six>=1.5 (from python-dateutil->-r requirements.txt (line 4)) Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl Collecting MarkupSafe>=0.23 (from Jinja2>=2.10->flask->-r requirements.txt (line 2)) Downloading https://files.pythonhosted.org/packages/bc/3a/6bfd7b4b202fa33bdda8e4e3d3acc719f381fd730f9a0e7c5f34e845bd4d/MarkupSafe-1.1.0-cp27-cp27mu-manylinux1_x86_64.whl Installing collected packages: greenlet, gevent, click, Werkzeug, itsdangerous, MarkupSafe, Jinja2, flask, urllib3, idna, chardet, certifi, requests, six, python-dateutil Successfully installed Jinja2-2.10 MarkupSafe-1.1.0 Werkzeug-0.14.1 certifi-2018.11.29 chardet-3.0.4 click-7.0 flask-1.0.2 gevent-1.3.7 greenlet-0.4.15 idna-2.8 itsdangerous-1.1.0 python-dateutil-2.7.5 requests-2.21.0 six-1.12.0 urllib3-1.24.1 Removing intermediate container b07fb0e2fd89 ---> 2740a2897715 Successfully built 2740a2897715 |
$vi Dockerfile
|
$docker build .
Sending build context to Docker daemon 2.048kB Step 1/8 : FROM debian:9 ---> 4879790bd60d Step 2/8 : RUN apt-get update ---> Using cache ---> daf1a37e0566 Step 3/8 : RUN apt-get install -y git-core python-virtualenv qrencode ---> Running in 528ade974968 Reading package lists... Building dependency tree... ... ---> ab31ab9d6b69 Step 7/8 : EXPOSE 8003 ---> Running in 80b2ee3d5b8c Removing intermediate container 80b2ee3d5b8c ---> 14dd1c4fa4ba Step 8/8 : CMD qrenco.de/ve/bin/python qrencode.de/bin/srv.py ---> Running in 249bf09a184f Removing intermediate container 249bf09a184f ---> ae04bd379156 Successfully built ae04bd379156 |
$docker im
![]() image images import |
$docker images
REPOSITORY TAG IMAGE ID CREATED SIZE <none> <none> ae04bd379156 About a minute ago 337MB <none> <none> 2740a2897715 9 minutes ago 337MB <none> <none> 431a808bf814 17 minutes ago 291MB <none> <none> 07d6cec1a65d 20 minutes ago 291MB nginx latest 568c4670fa80 3 weeks ago 109MB ubuntu latest 93fd78260bd1 4 weeks ago 86.2MB debian 9 4879790bd60d 5 weeks ago 101MB debian latest 4879790bd60d 5 weeks ago 101MB debian 8 39db55273026 5 weeks ago 127MB busybox latest 59788edf1f3e 2 months ago 1.15MB |
$docker run --rm -it ae04bd379156 bash
root@9fe8480a843b:/# uname -a Linux 9fe8480a843b 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux root@9fe8480a843b:/# exit exit |
$docker images
REPOSITORY TAG IMAGE ID CREATED SIZE tagnema latest e6b28e7a15fd 3 minutes ago 337MB <none> <none> ae04bd379156 5 minutes ago 337MB <none> <none> 2740a2897715 14 minutes ago 337MB <none> <none> 431a808bf814 22 minutes ago 291MB <none> <none> 07d6cec1a65d 25 minutes ago 291MB nginx latest 568c4670fa80 3 weeks ago 109MB ubuntu latest 93fd78260bd1 4 weeks ago 86.2MB debian 9 4879790bd60d 5 weeks ago 101MB debian latest 4879790bd60d 5 weeks ago 101MB debian 8 39db55273026 5 weeks ago 127MB busybox latest 59788edf1f3e 2 months ago 1.15MB |
$docker run --rm -it tagnema
![]() ^CKeyboardInterrupt 2018-12-21T13:35:29Z Traceback (most recent call last): File "bin/srv.py", line 168, in <module> server.serve_forever() File "/qrenco.de/ve/local/lib/python2.7/site-packages/gevent/baseserver.py", line 364, in serve_forever self._stop_event.wait() File "src/gevent/event.py", line 240, in gevent._event.Event.wait File "src/gevent/event.py", line 140, in gevent._event._AbstractLinkable._wait File "src/gevent/event.py", line 117, in gevent._event._AbstractLinkable._wait_core File "src/gevent/event.py", line 119, in gevent._event._AbstractLinkable._wait_core File "src/gevent/_greenlet_primitives.py", line 59, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/_greenlet_primitives.py", line 59, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/_greenlet_primitives.py", line 63, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch KeyboardInterrupt |
$curl http://localhost:8003/123
![]() curl: (7) Failed to connect to localhost port 8003: Connection refused |
$curl http://localhost:8003/123
█████████████████████████████ █████████████████████████████ ████ ▄▄▄▄▄ █▀█ █ █ ▄▄▄▄▄ ████ ████ █ █ █▄█▄▄▀█ █ █ ████ ████ █▄▄▄█ █ ▄▄█ █▄▄▄█ ████ ████▄▄▄▄▄▄▄█ █▄█▄█▄▄▄▄▄▄▄████ ████ ▀▄█▀▄▄▀▀ ▄▀▄ ▄█▄▄▀████ ████▄█▀▄ █▄ ▄ ▄▀▀ █▄▄█████ █████▄▄██▄▄▄ ██▄█ ▄▀▀▄▄▄████ ████ ▄▄▄▄▄ █▄██▄▄█ █▄▀▄ ▄████ ████ █ █ █▀ ▄█▄ ▀██ ████ ████ █▄▄▄█ █▀▄ ▀▄▄ █▀█▀▄████ ████▄▄▄▄▄▄▄█▄████▄█▄█▄▄██████ █████████████████████████████ █████████████████████████████ |
$docker run --rm -it -p 8003:8003 tagnema
![]() ::ffff:172.17.0.1 - - [2018-12-21 13:35:54] "GET /123 HTTP/1.1" 200 1320 0.008166 ::ffff:172.17.0.1 - - [2018-12-21 13:35:59] "GET /12234234 HTTP/1.1" 200 1312 0.008944 ^CKeyboardInterrupt 2018-12-21T13:38:10Z Traceback (most recent call last): File "bin/srv.py", line 168, in <module> server.serve_forever() File "/qrenco.de/ve/local/lib/python2.7/site-packages/gevent/baseserver.py", line 364, in serve_forever self._stop_event.wait() File "src/gevent/event.py", line 240, in gevent._event.Event.wait File "src/gevent/event.py", line 140, in gevent._event._AbstractLinkable._wait File "src/gevent/event.py", line 117, in gevent._event._AbstractLinkable._wait_core File "src/gevent/event.py", line 119, in gevent._event._AbstractLinkable._wait_core File "src/gevent/_greenlet_primitives.py", line 59, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/_greenlet_primitives.py", line 59, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/_greenlet_primitives.py", line 63, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch KeyboardInterrupt |
$curl http://localhost:8003/12234234
█████████████████████████████ █████████████████████████████ ████ ▄▄▄▄▄ █ ▄ ▄ █ ▄▄▄▄▄ ████ ████ █ █ █ ▀▀▀██ █ █ ████ ████ █▄▄▄█ █▀▀█▀▄█ █▄▄▄█ ████ ████▄▄▄▄▄▄▄█▄▀ ▀ █▄▄▄▄▄▄▄████ ████▄ █▀▄ ▄▀█▄▀ ▀██▄█ ▄████ ████ ▀█ ▄ █▀█▄█▀ ██▀ ████ ██████▄▄▄█▄▄ █ █ ██▄▄▀ ████ ████ ▄▄▄▄▄ █▀█▀▀ ▄█▄ ▀██▀████ ████ █ █ █▄▀▄ ▀█▄▄█▄ ████ ████ █▄▄▄█ █▀▄▀▄█▀ ▀ ▄▀█████ ████▄▄▄▄▄▄▄█▄███▄▄▄███▄▄▄████ █████████████████████████████ █████████████████████████████ |
$curl http://localhost:8003/12234234
![]() curl: (7) Failed to connect to localhost port 8003: Connection refused |
$cd ..
|
$cd ..
|
$git status
![]() fatal: Not a git repository (or any of the parent directories): .git |
$cd AWS/
|
$git status
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) docker/ nothing added to commit but untracked files present (use "git add" to track) |
$git add -p
No changes. |
$git status
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) docker/ nothing added to commit but untracked files present (use "git add" to track) |
$git add
Nothing specified, nothing added. Maybe you wanted to say 'git add .'? |
$git add docker/
|
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: docker/qrencode/Dockerfile |
$git commit -m 'new Dockerfile'
[master 40633f0] new Dockerfile Committer: ValeryBarai <user@m3.class.sl> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email you@example.com After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 11 insertions(+) create mode 100644 docker/qrencode/Dockerfile |
$git config --global user.name "ValeryBarai"
|
$git push
Username for 'https://github.com': ValeryBarai Password for 'https://ValeryBarai@github.com': Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (5/5), 581 bytes | 0 bytes/s, done. Total 5 (delta 0), reused 0 (delta 0) To https://github.com/ValeryBarai/AWS.git 0423fce..40633f0 master -> master |
$cd ..
|