summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-10-23 22:37:51 -0600
committermo khan <mo.khan@gmail.com>2020-10-23 22:37:51 -0600
commitd0ede407220ecee54fe3c8c2dab5bbc37e234e48 (patch)
treebcd4bc8b2b4620ce5b7908f66acedb1486983323
parent0af00104d1d6b64507e60693167188eba1b73016 (diff)
Add whalesay
-rw-r--r--README.md711
-rw-r--r--examples/001/Dockerfile7
2 files changed, 419 insertions, 299 deletions
diff --git a/README.md b/README.md
index 9b68805..6d2f360 100644
--- a/README.md
+++ b/README.md
@@ -43,17 +43,115 @@ Mo Khan | Software Developer | Calgary, AB, Canada.
# License scanning at GitLab
-As a compliance officer,
-I want a list of all the software licenses
-so that we don't get into legal trouble.
+```plaintext
+ ***********************
+ < Show me the licenses >
+ ***********************
+ \
+ \
+ \
+ ## .
+ ## ## ## ==
+ ## ## ## ## ===
+ /""""""""""""""""___/ ===
+ ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
+ \______ o __/
+ \ \ __/
+ \____\______/
+
+```
| Name | Version | Package Manager | License |
| ----- | ----- | --- | --- |
+| @rails/actioncable | 6.0.3-3 | Yarn | MIT |
+| @rails/ujs | 6.0.3-2 | Yarn | MIT |
+| @yarnpkg/lockfile | 1.1.0 | Yarn | BSD-2-Clause |
+| addressable | 2.7.0 | Bundler | Apache-2.0 |
+| bcrypt | 3.1.12 | Bundler | MIT |
+| cbor | 0.5.9.6 | Bundler | Apache-2.0 |
+| device_detector | 1.0.0 | Bundler | LGPL-3.0 |
+| devise | 4.7.3 | Bundler | MIT |
+| diffy | 3.3.0 | Bundler | MIT |
+| docutils | 0.13.1 | Pipenv | BSD-2-Clause |
+| elasticsearch | 6.8.2 | Bundler | Apache-2.0 |
+| eventmachine | 1.2.7 | Bundler | Ruby AND GPL-2.0 |
+| ffi | 1.13.1 | Bundler | BSD-3-Clause |
+| ffi-compiler | 1.0.1 | Bundler | Apache-2.0 |
+| jmespath | 1.4.0 | Bundler | Apache-2.0 |
+| kgio | 2.11.3 | Bundler | LGPL-2.1+ |
+| launchy | 2.4.3 | Bundler | ISC |
+| msgpack | 1.3.3 | Bundler | Apache-2.0 |
+| nokogumbo | 2.0.2 | Bundler | Apache-2.0 |
| rails | 6.0.3.3 | Bundler | MIT |
| vue | 2.6.12 | Yarn | MIT |
-| docutils | 0.13.1 | Pipenv | BSD-2-Clause |
-# How?
+# Constraints
+
+* supports multiple versions of:
+ * Dotnet Core
+ * Golang
+ * Java
+ * NodeJS
+ * PHP
+ * Python
+ * Ruby
+* supports multiple package managers:
+ * Bundler
+ * pip
+ * Pipenv
+ * Gradle
+ * Maven
+* includes system packages for common libraries:
+ * libpq-dev
+ * libsqlite3-dev
+* works in limited connectivity environments
+
+```plaintext
+ **************************************
+ < Must be deployed as a Docker image >
+ **************************************
+ \
+ \
+ \
+ ## .
+ ## ## ## ==
+ ## ## ## ## ===
+ /""""""""""""""""___/ ===
+ ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
+ \______ o __/
+ \ \ __/
+ \____\______/
+
+```
+
+
+# Constraints - 🤔
+
+We need to build a Docker image that can:
+
+* scan any codebase
+* install the version of tools needed
+* install the project dependencies
+* be small enough to fit on a CD-ROM
+
+```plaintext
+ ---------------
+ < Are you joking? >
+ ---------------
+
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+ `-----' `""""`'-----``"""` \ \_/
+```
+
+# How does this work?
```text
-------------
@@ -61,63 +159,31 @@ so that we don't get into legal trouble.
------------- ----------------
| main* | --> | gitlab-runner |
| feature-a | ----------------
- | feature-b | |
+ | feature-b | |
------------- launch container
- |
- V
+ |
+ V
---------------
- | | <----- 10GB ------
+ | | <-----------------
| Docker Host | --------- |
| | | |
--------------- | |
- | download |
- V | |
- ⭐⭐⭐⭐⭐⭐⭐ | |
- ⭐ License ⭐ ------------ |
- ⭐ Scanner ⭐ | registry | -|
- ⭐⭐⭐⭐⭐⭐⭐ ------------
- |
- publish report
- |
- V
+ | download |
+ V | |
+ ⭐⭐⭐⭐⭐⭐⭐⭐ V |
+ ⭐ License ⭐ ------------ |
+ ⭐ Scanner ⭐ | registry | -|
+ ⭐⭐⭐⭐⭐⭐⭐⭐ ------------
+ |
+ publish report
+ |
+ V
----------------
| gitlab-rails |
----------------
```
-# Constraints
-
-```plaintext
- --------------------------------------
- | Must be deployed as a Docker image |
- --------------------------------------
-```
-
-* Must support multiple versions of:
- * Dotnet Core
- * Golang
- * Java
- * Mono
- * NodeJS
- * PHP
- * Python
- * Ruby
- * Rust
- * etc
-* Must support multiple package managers:
- * Bundler
- * pip
- * pipenv
- * gradle
- * maven
- * etc
-* Must include system packages for common libraries:
- * libpq-dev
- * libsqlite3-dev
-
- 😒 🤔
-
-# How?
+# v1.0
1. Scan project for lock files (Gemfile.lock, Pipfile.lock etc)
2. Install project tools (Ruby 2.7.2, Python 3.8.4)
@@ -125,43 +191,136 @@ so that we don't get into legal trouble.
4. Scan for licenses
5. Export JSON report
-# What?
+```plaintext
+ ************
+ | APPLAUSE |
+ ************
+```
+
+| Name | Version | Package Manager | License |
+| ----- | ----- | --- | --- |
+| @rails/actioncable | 6.0.3-3 | Yarn | MIT |
+| @rails/ujs | 6.0.3-2 | Yarn | MIT |
+| @yarnpkg/lockfile | 1.1.0 | Yarn | BSD-2-Clause |
+| addressable | 2.7.0 | Bundler | Apache-2.0 |
+| bcrypt | 3.1.12 | Bundler | MIT |
+| cbor | 0.5.9.6 | Bundler | Apache-2.0 |
+| device_detector | 1.0.0 | Bundler | LGPL-3.0 |
+
+```plaintext
+ ---------------------------
+ < Yay! We can detect licenses >
+ ---------------------------
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+`-----' `""""`'-----``"""` \ \_/
+```
+
+# Why so slow?
-Large Docker images
+```plaintext
+ _____________________________________
+< That's cool, but why is it so slow? >
+ -------------------------------------
+ \
+ \
+ \
+ ## .
+ ## ## ## ==
+ ## ## ## ## ===
+ /""""""""""""""""___/ ===
+ ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
+ \______ o __/
+ \ \ __/
+ \____\______/
+```
+
+# Overview
+
+```text
+ ---------------
+ | | <-----------------
+ | Docker Host | --------- |
+ | | | |
+ --------------- | |
+ | download |
+ V | |
+ ⭐⭐⭐⭐⭐⭐⭐⭐ V |
+ ⭐ License ⭐ ------------ |
+ ⭐ Scanner ⭐ | registry | -|
+ ⭐⭐⭐⭐⭐⭐⭐⭐ ------------
+ |
+ publish report
+ |
+ V
+ ----------------
+ | gitlab-rails |
+ ----------------
+```
+
+# What happens if the Docker image is too large?
* slow downloads
* more disk space is required
* more bandwidth is consumed
-# Zoom in
+```plaintext
+ ---------------
+ < That's not good >
+ ---------------
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+`-----' `""""`'-----``"""` \ \_/
+```
+
-How did you shrink the image from 10GB down to 1GB?
+# Overview
```text
---------------
- | | <----- 10GB ------
+ | | <------ 10GB -----
| Docker Host | --------- |
| | | |
--------------- | |
- | download |
- V | |
- -------------- V |
- | License | ------------ |
- | scanner | | registry | -|
- -------------- ------------
+ | download |
+ V | |
+ ⭐⭐⭐⭐⭐⭐⭐⭐ V |
+ ⭐ License ⭐ ------------ |
+ ⭐ Scanner ⭐ | registry | -|
+ ⭐⭐⭐⭐⭐⭐⭐⭐ ------------
```
-```bash
- モ ls ~/development/gitlab | grep lock
- Gemfile.lock
- Pipfile.lock
- yarn.lock
-```
+```plaintext
+ --------------------------------------
+ < Yikes! It takes 6 minutes to download >
+ --------------------------------------
-Also added
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+`-----' `""""`'-----``"""` \ \_/
+```
-* Support for more languages and versions.
-* Support for limited connectivity environments.
# Agenda
@@ -189,14 +348,10 @@ Also added
# Definitions
-* Image
-* Container
-* Registry
-
-# Definitions - Image
-
-A Docker image is similar to a Ruby class.
-A class defines the behaviour and data associated with the class.
+| Ruby | Docker |
+| -- | -- |
+| Class | Image |
+| Object | Container |
```ruby
class Person
@@ -210,38 +365,13 @@ class Person
puts "#{name} 🤗 #{other.name}"
end
end
-```
-
-# Definitions
-
-You can't do much with a class until you create
-an instance of one.
-
-```ruby
- mo = Person.new("mo")
- me = Person.new("me")
-```
-
-# Definitions - Objects
-Once a class is instantiated you can invoke
-methods on the object. An object can interact
-with other objects.
+mo = Person.new("mo")
+me = Person.new("me")
-```ruby
- mo.hugs(me)
+mo.hugs(me)
```
-# Definitions - Container
-
-A container is a running instance of an image.
-Similar to how an object is an instance of a class.
-
-| Ruby | Docker |
-| -- | -- |
-| Class | Image |
-| Object | Container |
-
# Definitions - Registry
Registry: stores images and makes them available to others
@@ -253,10 +383,6 @@ For example:
* https://registry-1.docker.io
* https://registry.gitlab.com
-```bash
-curl -s -i https://registry-1.docker.io/v2/alpine/tags/list
-```
-
# Architecture
```text
@@ -299,63 +425,15 @@ docker run -it alpine:latest cat /etc/os-release
# Dockerfile
-```file
-path: examples/001/Dockerfile
-relative: true
-lang: docker
-```
-
-https://docs.docker.com/engine/reference/builder/
-
-# FROM alpine:latest
-
-Initializes a build stage and sets a Base Image.
-
-```file
-path: examples/001/Dockerfile
-relative: true
-lang: docker
-```
-
-# COPY "hello.rb"
-
-Copy "hello.rb" from the host to "/usr/local/bin/hello" in the Docker image.
-
-```bash
-$ cat examples/001/hello.rb
-```
-```file
-path: examples/001/hello.rb
-relative: true
-lang: ruby
-```
-
-# Dockerfile - RUN
-
-RUN a command from within the image and make "hello" executable.
+Defines how to build a Docker image.
```file
path: examples/001/Dockerfile
relative: true
lang: docker
-lines:
- start: 2
- end: 3
```
-# Dockerfile - CMD
-
-Set the default command to run when the docker image
-is launched as a container.
-
-```file
-path: examples/001/Dockerfile
-relative: true
-lang: docker
-lines:
- start: 3
- end: 4
-```
+https://docs.docker.com/engine/reference/builder/
# docker build -t developing-with-docker:latest examples/001/
@@ -369,86 +447,49 @@ docker build --network=host -t developing-with-docker:latest examples/001/
docker run developing-with-docker:latest
```
-# dive
+# Analysis
-Useful for identifying bloat.
-https://github.com/wagoodman/dive
+A docker image is made up of multiple layers.
+Each layer is a snapshot of the filesystem
+stored as an archive.
-* Displays each layer
-* Allows investigating files that are added/removed/changed in each layer
+```plaintext
+ --------------
+ < Let's dive in! >
+ --------------
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+`-----' `""""`'-----``"""` \ \_/
+```
+
+# Analysis - dive
-# dive original
+```file
+path: examples/001/Dockerfile
+relative: true
+lang: docker
+```
```bash
-│ Layers ├──────────────────────────────────────────────────────────────────────────── ┃ ● Current Layer Contents ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-Cmp Size Command Permission UID:GID Size Filetree
- 5.6 MB FROM 5a96ef02e9cab83 drwxr-xr-x 0:0 841 kB ├─⊕ bin
- 40 B #(nop) COPY file:253d38e67af26b201caf4e271248576ba6a7da0431f5ddee20c5c6df5 drwxr-xr-x 0:0 0 B ├── dev
- 16 MB apk add ruby drwxr-xr-x 0:0 383 kB ├─⊕ etc
- 40 B chmod +x /usr/local/bin/hello drwxr-xr-x 0:0 0 B ├── home
- drwxr-xr-x 0:0 3.9 MB ├─⊕ lib
-│ Layer Details ├───────────────────────────────────────────────────────────────────── drwxr-xr-x 0:0 0 B ├─⊕ media
- drwxr-xr-x 0:0 0 B ├── mnt
-Tags: (unavailable) drwxr-xr-x 0:0 0 B ├── opt
-Id: e19b1e8ac9df6c9165f82c5e278f4d8b4839c8e6727001a12477e3947ffd83ea dr-xr-xr-x 0:0 0 B ├── proc
-Digest: sha256:aebe0431f34491da1f2785934e4190cfb9fbba01fc1aeff69f13c139a6ccac65 drwx------ 0:0 0 B ├── root
-Command: drwxr-xr-x 0:0 0 B ├── run
-apk add ruby drwxr-xr-x 0:0 226 kB ├─⊕ sbin
- drwxr-xr-x 0:0 0 B ├── srv
-│ Image Details ├───────────────────────────────────────────────────────────────────── drwxr-xr-x 0:0 0 B ├── sys
- drwxrwxrwx 0:0 0 B ├── tmp
- drwxr-xr-x 0:0 14 MB ├─⊕ usr
-Total Image size: 21 MB drwxr-xr-x 0:0 1.8 MB └─⊕ var
-Potential wasted space: 532 kB
-Image efficiency score: 98 %
-
-Count Total Space Path
- 2 428 kB /etc/ssl/certs/ca-certificates.crt
- 2 79 kB /lib/apk/db/installed
- 2 25 kB /lib/apk/db/scripts.tar
- 2 288 B /lib/apk/db/triggers
- 2 123 B /etc/apk/world
- 2 80 B /usr/local/bin/hello
- 2 0 B /lib/apk/db/lock
- 2 0 B /var/cache/misc
-```
-
-# dive - layers
+$ dive developing-with-docker:latest
-```bash
│ Layers ├─────────────────────────────────────────────────────────
-Cmp Size Command
- 5.6 MB FROM 5a96ef02e9cab83
- 40 B #(nop) COPY file:253d38e67af26b201caf4e271248576ba6a7da
- 16 MB apk add ruby
- 40 B chmod +x /usr/local/bin/hello
-
-│ Layer Details ├──────────────────────────────────────────────────
-
-Tags: (unavailable)
-Id: e19b1e8ac9df6c9165f82c5e278f4d8b4839c8e6727001a12477e3947ff
-Digest: sha256:aebe0431f34491da1f2785934e4190cfb9fbba01fc1aeff69f13
-Command:
-apk add ruby
-
-│ Image Details ├──────────────────────────────────────────────────
-
-
-Total Image size: 21 MB
-Potential wasted space: 532 kB
-Image efficiency score: 98 %
-
-Count Total Space Path
- 2 428 kB /etc/ssl/certs/ca-certificates.crt
- 2 79 kB /lib/apk/db/installed
- 2 25 kB /lib/apk/db/scripts.tar
- 2 288 B /lib/apk/db/triggers
- 2 123 B /etc/apk/world
- 2 80 B /usr/local/bin/hello
- 2 0 B /lib/apk/db/lock
- 2 0 B /var/cache/misc
+Size Command
+5.6 MB FROM 5a96ef02e9cab83
+ 16 MB apk add ruby
+ 40 B #(nop) COPY file:253d38e67af26b201caf4e271248576ba6a7da
+ 40 B chmod +x /usr/local/bin/hello
```
+https://github.com/wagoodman/dive
+
# dive - layer details
```bash
@@ -473,10 +514,29 @@ drwxr-xr-x 0:0 14 MB ├─⊕ usr
drwxr-xr-x 0:0 1.8 MB └─⊕ var
```
-# docker pull - back then
+# License scanner - v1.0
+
+```plaintext
+ __________________________________
+/ How many layers does the license \
+\ scanner image have? /
+ ----------------------------------
+ \
+ \
+ \
+ ## .
+ ## ## ## ==
+ ## ## ## ## ===
+ /""""""""""""""""___/ ===
+ ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
+ \______ o __/
+ \ \ __/
+ \____\______/
+```
+
+# docker pull - v1.0
```bash
-2.8.0: Pulling from gitlab-org/security-products/license-management
0a01a72a686c: Pull complete
cc899a5544da: Pull complete
19197c550755: Pull complete
@@ -518,18 +578,77 @@ e17797fa5e82: Waiting
9003b36c1e4e: Waiting
```
-# Start with a minimal base image
+# Layer cake
+
+```plaintext
+...
+50d1fb4b55b2: Download complete
+276696690bcf: Download complete
+5eec42d5363b: Download complete
+2296aa2193e9: Download complete
+5fe4c102c0bc: Download complete
+97390612da81: Downloading [=====> ] 81.05MB/174MB
+311b1e270e29: Downloading [===========> ] 42.12MB/189.4MB
+53dfbd975f60: Downloading [=> ] 25.36MB/843.4MB
+3dd2acdebe0f: Waiting
+d548f098494f: Waiting
+da1cc42017ff: Waiting
+cfc3cd025ca9: Waiting
+69ea647e6c07: Waiting
+1e27d5f85aa2: Waiting
+94cf5e06627d: Waiting
+30e1f788589d: Waiting
+d9238ec317d1: Waiting
+e17797fa5e82: Waiting
+9003b36c1e4e: Waiting
+ _______________________
+ < That's a lot of layers! >
+ -----------------------
+ \
+ \
+ \
+ ## .
+ ## ## ## ==
+ ## ## ## ## ===
+ /""""""""""""""""___/ ===
+ ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
+ \______ o __/
+ \ \ __/
+ \____\______/
-```Dockerfile
-FROM licensefinder/license_finder:5.6.2
```
+# Start with a minimal base image
+
```bash
REPOSITORY TAG SIZE
debian stable-slim 69.2MB
licensefinder/license_finder 5.6.2 3.63GB
```
+```plaintext
+ ------------------------------
+ < Let's try a smaller base image >
+ ------------------------------
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+`-----' `""""`'-----``"""` \ \_/
+ `-`
+```
+
+```Dockerfile
+FROM licensefinder/license_finder:5.6.2
+```
+
+to
+
```Dockerfile
FROM debian:stable-slim
```
@@ -607,7 +726,7 @@ apt-get install -y --no-install-recommends \
# Deflate
-Compress directories that are large during build time.
+Compress files that are large during build time.
```bash
#!/bin/bash
@@ -633,7 +752,7 @@ deflate /usr/share/dotnet.tar.zst dotnet
# Inflate
-Decompress directories when the container is launched
+Decompress files when the container is launched
by hooking into the ENTRYPOINT.
```Dockerfile
@@ -675,7 +794,7 @@ build do
"--disable-jit-support",
"--enable-shared",
"--prefix=#{install_dir}",
- "--with-out-ext=coverage,dbm,readline,rdoc,win32,win32ole,sdbm",
+ "--with-out-ext=coverage,dbm,readline,rdoc,win32,win32ole,...",
"--without-gdbm",
"--without-gmp",
"--without-jemalloc",
@@ -690,72 +809,68 @@ end
```bash
# ls -lh /opt/toolcache/ruby-* | awk '{ print $5 " " $9 }'
-5.3M /opt/toolcache/ruby-2.4.10_2.4.10-1_amd64.deb
-5.3M /opt/toolcache/ruby-2.4.5_2.4.5-1_amd64.deb
-5.3M /opt/toolcache/ruby-2.4.9_2.4.9-1_amd64.deb
-5.4M /opt/toolcache/ruby-2.5.8_2.5.8-1_amd64.deb
-5.6M /opt/toolcache/ruby-2.6.0_2.6.0-1_amd64.deb
-5.6M /opt/toolcache/ruby-2.6.1_2.6.1-1_amd64.deb
-5.6M /opt/toolcache/ruby-2.6.2_2.6.2-1_amd64.deb
-5.6M /opt/toolcache/ruby-2.6.3_2.6.3-1_amd64.deb
-5.6M /opt/toolcache/ruby-2.6.4_2.6.4-1_amd64.deb
-5.6M /opt/toolcache/ruby-2.6.5_2.6.5-1_amd64.deb
-5.6M /opt/toolcache/ruby-2.6.6_2.6.6-1_amd64.deb
-5.7M /opt/toolcache/ruby-2.7.0_2.7.0-1_amd64.deb
-5.7M /opt/toolcache/ruby-2.7.1_2.7.1-1_amd64.deb
-5.7M /opt/toolcache/ruby-2.7.2_2.7.2-1_amd64.deb
+5.3M /opt/toolcache/ruby-2.4.10-1_amd64.deb
+5.3M /opt/toolcache/ruby-2.4.5-1_amd64.deb
+5.3M /opt/toolcache/ruby-2.4.9-1_amd64.deb
+5.4M /opt/toolcache/ruby-2.5.8-1_amd64.deb
+5.6M /opt/toolcache/ruby-2.6.0-1_amd64.deb
+5.6M /opt/toolcache/ruby-2.6.1-1_amd64.deb
+5.6M /opt/toolcache/ruby-2.6.2-1_amd64.deb
+5.6M /opt/toolcache/ruby-2.6.3-1_amd64.deb
+5.6M /opt/toolcache/ruby-2.6.4-1_amd64.deb
+5.6M /opt/toolcache/ruby-2.6.5-1_amd64.deb
+5.6M /opt/toolcache/ruby-2.6.6-1_amd64.deb
+5.7M /opt/toolcache/ruby-2.7.0-1_amd64.deb
+5.7M /opt/toolcache/ruby-2.7.1-1_amd64.deb
+5.7M /opt/toolcache/ruby-2.7.2-1_amd64.deb
```
# Results
-```bash
-REPOSITORY TAG SIZE
-analyzers/license-finder 3.28.1 1.4GB
-analyzers/license-finder 2.8.0 9.83GB
-analyzers/license-finder 1.5.0 4.06GB
+| Image | Tag | Size |
+| ----- | ----- | --- |
+| license-scanner | 3.28.1 | 1.4GB |
+| license-scanner | 2.8.0 | **9.83GB** |
+| license-scanner | 1.5.0 | 4.06GB |
+
+```plaintext
+ ------------
+ < 9.83GB to 1.4GB. Better! >
+ ------------
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+`-----' `""""`'-----``"""` \ \_/
```
# Summary
* Keep each layer small
-* More layers provides opportunity for more parallel downloads
-* Download will block on the largest layer.
-* Too many layers can cause too many parallel downloads
-* Try to collapse layers by grouping logical things together
-* Cleanup unnecessary artifacts in each layer
-* Deflate files when building layers
-* Inflate files when container is launched
+* Grouping install steps together
+* Cleanup transient artifacts in each layer
+* Deflate files at building time
+* Inflate files at run time
-Thank you
+```plaintext
+ ----------
+ < Thank you >
+ ----------
+ .---.
+ /o o\
+ __(= " =)__
+ //\'-=-'/\\
+ ) (_
+ / `"=-._
+ / \ ``"=.
+ / / \ \ `=..--.
+ ___/ / \ \___ _, , `\
+`-----' `""""`'-----``"""` \ \_/
+```
[gitlab.com/xlgmokha/developing-with-docker](https://gitlab.com/xlgmokha/developing-with-docker)
-
-# Feedback
-
-* people will know what Docker is
-* watch the screen from different sizes
- * increase size and not make it black background. hard to see.
- * white background
-* Take into account:
- * Not native English speakers
- * Don't use fancy English words
- * Talk slower: adjust talking speed based on the audience.
-* What is the story?
- * Explain the problem and context of the situation and why are we interested in layers and this talk.
- * Why should I watch this talk?
- * Visitors may not be engaged so do something to promote and get people interested in what you will share.
- * explain why we had this problem and explain how the scanner works in the context of a CI build.
- * What is the problem that this person is solving?
-* Mostly Ruby On Rails focused audience there are some devops interested people.
- * Some people are interested in learning how to shrink Docker images and this can be useful to people.
-* I want you to learn about:
- * zstandard
- * debian/rpm/apk packaging (omnibus)
-
-Best talk:
-
-* Idea
-* drop everything that does not support this idea around this talk.
-* Pattern: humans get bored, get distracted and return.
- * If I don't understand when I return then I don't like it anymore.
- * goal: If you get distracted for a second you can still understand what is going on.
diff --git a/examples/001/Dockerfile b/examples/001/Dockerfile
index 3657293..3cab792 100644
--- a/examples/001/Dockerfile
+++ b/examples/001/Dockerfile
@@ -1,5 +1,10 @@
+# Initializes a build stage and sets a Base Image.
FROM alpine:latest
-COPY hello.rb /usr/local/bin/hello
+# Install the ruby package
RUN apk add ruby
+# Copy file from the host to the Docker image.
+COPY hello.rb /usr/local/bin/hello
+# Give "hello" the executable permission
RUN chmod +x /usr/local/bin/hello
+# Set the default command to run
CMD ["hello"]