Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lesson_3/ex1_solution.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

- Image Size:
- Container Name:
- Container ID:
- Exposed port:
- Postgres version:
- Data Volume (aka PGDATA):
- default entrypoint:
- default command:
- baseline consumption : CPU ___% MEM ___MB
- Image Size: 377MB
- Container Name: some-postgres
- Container ID: 021d486917aa
- Exposed port: 5432/tcp
- Postgres version: 15.0-1.pgdg110+1
- Data Volume (aka PGDATA): /var/lib/postgresql/data
- default entrypoint: docker-entrypoint.sh
- default command: postgres
- baseline consumption : CPU 0.00% MEM 31.37MiB
- OS: Distro Version Codename (Ubuntu 22.04 jammy)
6 changes: 5 additions & 1 deletion lesson_3/ex1_solution.sh
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
docker pull
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
docker ps -h
docker inspect postgress
docker images postgres
docker stats some-postgress
7 changes: 5 additions & 2 deletions lesson_3/ex2_solution.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx 1.22.1-perl df1998569adb 10 days ago 188MB
nginx 1.22.1 0ccb2559380c 10 days ago 142MB
nginx 1.22.1-alpine-perl 98f7c1f8a3fa 2 weeks ago 58.6MB
nginx 1.22.1-alpine ec84f916d1ec 2 weeks ago 23.6MB
5 changes: 4 additions & 1 deletion lesson_3/ex2_solution.sh
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
docker pull
docker pull nginx:1.22.1-perl
docker pull nginx:1.22.1-alpine-perl
docker pull nginx:1.22.1-alpine
docker pull nginx:1.22.1
23 changes: 21 additions & 2 deletions lesson_4/ex1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@ pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

server {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

}
access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
server {
listen 8888;
root /var/www/;
index index.html;
}

}
11 changes: 11 additions & 0 deletions lesson_4/ex1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
docker run --name some-nginx -p 8011:80 -d nginx:1.22.1
docker exec -ti some-nginx /bin/bash
cat /etc/nginx/nginx.conf
exit
docker stop some-nginx
docker rm some-nginx
docker run --name some-nginx -p 8888:80 -d -v /home/cursodocker/dockerexercises/docker_exercises/lesson_4/ex1.conf:/etc/nginx/nginx.conf -v /home/cursodocker/dockerexercises/docker_exercises/lesson_4/src/ex1_web.html:/var/www/index.html nginx:1.22.1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recorda que podes user $(pwd) para substituír o teu directorio actual. Na maioría dos casos unha ruta relativa vai funcionar. Eu uso ./folder/file.conf co "./" diante para indicar claramente que é unha ruta relativa e diferenciar do nome dun volument (que en casos extremos odería coincidir cun nome de volume)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modificaches o ex1.conf? o que hai está sen completar

docker logs my-nginx
docker stop some-nginx
docker inspect some-nginx

104 changes: 100 additions & 4 deletions lesson_4/ex1_solution.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,115 @@
### Part 1
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.





### Part 2

### Part 3 logs
Pese a que los volumenes parecen bien montados y los archivos efectivamente están donde deberían, no me muestra la página correcta ni a tiros.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revisa o ex1.conf. Tes que modificalo usando o nginx.conf de dentro máis a sección "server" de lesson_4/src/nginx.conf

Tampoco me deja ver los logs de nginx desde dentro de la maquina

### Part 3 logs
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2022/11/10 19:29:05 [notice] 1#1: using the "epoll" event method
2022/11/10 19:29:05 [notice] 1#1: nginx/1.22.1
2022/11/10 19:29:05 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
2022/11/10 19:29:05 [notice] 1#1: OS: Linux 5.10.102.1-microsoft-standard-WSL2
2022/11/10 19:29:05 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/11/10 19:29:05 [notice] 1#1: start worker processes
2022/11/10 19:29:05 [notice] 1#1: start worker process 29
2022/11/10 19:29:05 [notice] 1#1: start worker process 30
2022/11/10 19:29:05 [notice] 1#1: start worker process 31
2022/11/10 19:29:05 [notice] 1#1: start worker process 32
2022/11/10 19:29:05 [notice] 1#1: start worker process 33
2022/11/10 19:29:05 [notice] 1#1: start worker process 34
2022/11/10 19:29:05 [notice] 1#1: start worker process 35
2022/11/10 19:29:05 [notice] 1#1: start worker process 36
2022/11/10 19:31:47 [notice] 1#1: signal 1 (SIGHUP) received from 50, reconfiguring
2022/11/10 19:31:47 [notice] 1#1: reconfiguring
2022/11/10 19:31:47 [notice] 1#1: using the "epoll" event method
2022/11/10 19:31:47 [notice] 1#1: start worker processes
2022/11/10 19:31:47 [notice] 1#1: start worker process 53
2022/11/10 19:31:47 [notice] 1#1: start worker process 54
2022/11/10 19:31:47 [notice] 1#1: start worker process 56
2022/11/10 19:31:47 [notice] 1#1: start worker process 57
2022/11/10 19:31:47 [notice] 1#1: start worker process 59
2022/11/10 19:31:47 [notice] 1#1: start worker process 60
2022/11/10 19:31:47 [notice] 1#1: start worker process 61
2022/11/10 19:31:47 [notice] 1#1: start worker process 63
2022/11/10 19:31:47 [notice] 29#29: gracefully shutting down
2022/11/10 19:31:47 [notice] 30#30: gracefully shutting down
2022/11/10 19:31:47 [notice] 32#32: gracefully shutting down
2022/11/10 19:31:47 [notice] 31#31: gracefully shutting down
2022/11/10 19:31:47 [notice] 33#33: gracefully shutting down
2022/11/10 19:31:47 [notice] 32#32: exiting
2022/11/10 19:31:47 [notice] 29#29: exiting
2022/11/10 19:31:47 [notice] 30#30: exiting
2022/11/10 19:31:47 [notice] 34#34: gracefully shutting down
2022/11/10 19:31:47 [notice] 36#36: gracefully shutting down
2022/11/10 19:31:47 [notice] 33#33: exiting
2022/11/10 19:31:47 [notice] 31#31: exiting
2022/11/10 19:31:47 [notice] 34#34: exiting
2022/11/10 19:31:47 [notice] 36#36: exiting
2022/11/10 19:31:47 [notice] 33#33: exit
2022/11/10 19:31:47 [notice] 29#29: exit
2022/11/10 19:31:47 [notice] 32#32: exit
2022/11/10 19:31:47 [notice] 30#30: exit
2022/11/10 19:31:47 [notice] 31#31: exit
2022/11/10 19:31:47 [notice] 34#34: exit
2022/11/10 19:31:47 [notice] 36#36: exit
2022/11/10 19:31:47 [notice] 35#35: gracefully shutting down
2022/11/10 19:31:47 [notice] 35#35: exiting
2022/11/10 19:31:47 [notice] 35#35: exit
2022/11/10 19:31:47 [notice] 1#1: signal 17 (SIGCHLD) received from 31
2022/11/10 19:31:47 [notice] 1#1: worker process 31 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: signal 29 (SIGIO) received
2022/11/10 19:31:47 [notice] 1#1: signal 17 (SIGCHLD) received from 36
2022/11/10 19:31:47 [notice] 1#1: worker process 29 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: worker process 34 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: worker process 36 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: signal 29 (SIGIO) received
2022/11/10 19:31:47 [notice] 1#1: signal 17 (SIGCHLD) received from 32
2022/11/10 19:31:47 [notice] 1#1: worker process 32 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: signal 29 (SIGIO) received
2022/11/10 19:31:47 [notice] 1#1: signal 17 (SIGCHLD) received from 30
2022/11/10 19:31:47 [notice] 1#1: worker process 30 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: worker process 33 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: worker process 35 exited with code 0
2022/11/10 19:31:47 [notice] 1#1: signal 29 (SIGIO) received
2022/11/10 19:31:47 [notice] 1#1: signal 17 (SIGCHLD) received from 35
172.17.0.1 - - [10/Nov/2022:19:31:52 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:53 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:53 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:54 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:54 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:54 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:55 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:55 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:55 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:56 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:56 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"
172.17.0.1 - - [10/Nov/2022:19:31:56 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26" "-"

### Part 4 status

Name
Status
Exit code
Name /some-nginx
Status exited
Exit code 0