Hello!
I am Abdala Cerqueira
I am here because I love to learn and share.
2
Slide 3
Slide 3 text
3
Thank you!
Slide 4
Slide 4 text
1.
Docker
Docker solved one of my biggest issues: dependency
4
Slide 5
Slide 5 text
Dependencies
▷ Easy to add, hard to remove
▷ Security problems
▷ Difficult to manage
I don’t like dependencies!
5
Slide 6
Slide 6 text
Install
Freedom to install, test and
isolate any source code in my
computer
Docker gave me freedom
Remove
Docker organizes it in a way
that is easy to add and delete
dependencies safely
6
Slide 7
Slide 7 text
Let’s get hands dirty
7
It’s time to use terminal
Slide 8
Slide 8 text
First part conclusions
▷ No more concerns about
dependencies
▷ Freedom to install and run any
source code
▷ It's possible to version almost
everything in your machine
8
Slide 9
Slide 9 text
2.
Dockerfile
Passion about size and speed
9
Slide 10
Slide 10 text
Dockerfile
Problem 1
Keep different Dockerfiles per environment
Problem 2
Send development dependencies to production
Problem 3
Create big, huge, immense images. One or two
commands may leave images out of control
10
Slide 11
Slide 11 text
11
Dependencies
Slide 12
Slide 12 text
12
Dependencies!
Slide 13
Slide 13 text
The last scan in March 11, 2019
13
https://snyk.io/blog/the-top-two-most-popular-docker-base-images-each-have-over-500-vulnerabilities
Checklist
▷ Have only one Dockerfile regardless of
the environment
▷ Don’t have development dependencies in
production
▷ Manage less dependencies
▷ Create small images (< 100MB)
15
Slide 16
Slide 16 text
Examples
▷ Docker in Docker (dind)
▷ Standard Laravel project
composer create-project laravel/laravel
▷ PHP as Apache module (Horizontal scale)
▷ Pre-downloaded and pre-builded images
16
Slide 17
Slide 17 text
17
Slide 18
Slide 18 text
Let’s go deeper
18
It’s time to use terminal
Slide 19
Slide 19 text
Checklist
▷ Have only one Dockerfile regardless of
the environment
▷ Don’t have development dependencies in
production
▷ Manage less dependencies
▷ Create small images (< 100MB)
19
Slide 20
Slide 20 text
20
Multi-stage
Slide 21
Slide 21 text
“
Multi-stage builds are useful to anyone who has
struggled to optimize Dockerfiles while keeping
them easy to read and maintain.
21
https://docs.docker.com/develop/develop-images/multistage-build
Slide 22
Slide 22 text
22
Slide 23
Slide 23 text
23
Slide 24
Slide 24 text
24
Slide 25
Slide 25 text
25
Slide 26
Slide 26 text
26
Slide 27
Slide 27 text
Checklist
▷ Have only one Dockerfile regardless of
the environment
▷ Don’t have development dependencies in
production
▷ Manage less dependencies
▷ Create small images (< 100MB)
27
Slide 28
Slide 28 text
28
Alpine Linux
Slide 29
Slide 29 text
“
Small. Simple. Secure.
Alpine Linux is a security-oriented, lightweight
Linux distribution based on musl libc and
busybox.
29
https://alpinelinux.org
Slide 30
Slide 30 text
30
Slide 31
Slide 31 text
31
Slide 32
Slide 32 text
32
Slide 33
Slide 33 text
33
Slide 34
Slide 34 text
34
Slide 35
Slide 35 text
Checklist
▷ Have only one Dockerfile regardless of
the environment
▷ Don’t have development dependencies in
production
▷ Manage less dependencies
▷ Create small images (< 100MB)
35
Final considerations
▷ Care about security
▷ Care about dependencies
▷ Care about size and speed
▷ Automate your processes
42
Slide 43
Slide 43 text
Thanks!
Any questions?
You can find me at:
@abdalac
Feedback:
https:/
/joind.in/talk/3e7bc
43
https://joind.in/talk/3e7bc
Slide 44
Slide 44 text
Credits
Special thanks to all the people who made and
released these awesome resources for free:
▷ Presentation template by SlidesCarnival
▷ Photographs by Unsplash
44