Skip to content

Commit

Permalink
Add container stuff and images
Browse files Browse the repository at this point in the history
  • Loading branch information
DoPaNik committed Dec 10, 2023
1 parent 4a7b04c commit 0bf0dd3
Show file tree
Hide file tree
Showing 14 changed files with 2,462 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 2_supplychain/1_theorie/Container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Container

## Container Grundlagen

### Was ist ein Container?

Ein Container ist eine isolierte Umgebung, die eine Anwendung und alle ihre Abhängigkeiten enthält. Container teilen sich das Betriebssystem des Hosts, aber jede Container-Anwendung läuft isoliert im Benutzermodus.

### Container vs. VMs

![Container vs. VMs](../99_assets/images/container-vs-vm.png)

### Virtual Machines
![Virtual Machines](../99_assets/images/vm-overview.png)

### Container
![Container](../99_assets/images/container-overview.png)

### Container Security
![Container Security](../99_assets/images/container-security.png)
31 changes: 31 additions & 0 deletions 2_supplychain/1_theorie/Dockerfiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Dockerfile

## Problemstellung
### Keine Reproduzierbarkeit beim Base Image
- Base Image ist nicht reproduzierbar
- Base Image ist nicht verifizierbar

#### Lösung
- Base Image selbst bauen
- Base Image verifizieren
- Base Image Version pinning

### Keine Reproduzierbarkeit beim Build
- Build ist nicht reproduzierbar
- Build ist nicht verifizierbar

#### Lösung
- Build verifizieren
- Build Version pinning (package-lock.json, Gemfile.lock, requirements.txt)

### Layering
- Falsche Reihenfolge der Layer

#### Lösung
- Dateien mit häufigen Änderungen nach unten

### Root User
- Root User in Container

#### Lösung
- Letzer User sollte nicht root sein
3 changes: 3 additions & 0 deletions 2_supplychain/1_theorie/Übersicht.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Application iceberg concept

![Application iceberg concept](../99_assets/images/application-iceberg-concept.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# BAD EXAMPLE - DO NOT USE
FROM python:latest
RUN pip install flask
COPY app.py /
USER root
CMD [ "python", "./app.py" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.7.3-stretch@sha256:a1c56db383e4169ce242f88c527608869afcb813e55b29d46ca3476b3edc4de7
COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt --no-cache-dir && useradd --create-home appuser
WORKDIR /home/appuser
USER appuser
COPY app.py .
CMD [ "python", "./app.py" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask==2.0.1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2_supplychain/99_assets/images/container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2_supplychain/99_assets/images/vm-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2_supplychain/99_assets/images/vms .png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0bf0dd3

Please sign in to comment.