Compare commits
1 Commits
ccd5038ce6
...
c2fc71bbbf
Author | SHA1 | Date | |
---|---|---|---|
c2fc71bbbf |
73
README.md
73
README.md
@ -1,3 +1,72 @@
|
|||||||
# docker-compose-workshop
|
# Vorraussetzungen
|
||||||
|
|
||||||
Docker-Compose workshop
|
Folgendes wird in Linux gemacht (es ist aber nicht zwingend ein eigenes Linux erforderlich):
|
||||||
|
|
||||||
|
* Erstellen und bearbeiten von Dateien (Shell oder GUI)
|
||||||
|
* Starten von Programmen auf der Commandline
|
||||||
|
|
||||||
|
## Installation in Ubuntu Linux
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
sudo apt install docker-compose
|
||||||
|
sudo adduser <user> docker # allow docker as user
|
||||||
|
su <user> # relogin or reboot system to apply new group
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Ohne Linux
|
||||||
|
|
||||||
|
### Verbinden über ssh (z.B. mit Putty) auf meinen Rechner.
|
||||||
|
|
||||||
|
Wer kein eigenes Linux hat, kann sich über ssh mit meinem Rechner verbinden. Das müssen wir vorher üben. Bitte rechtzeitig melden.
|
||||||
|
In diesem Fall ist es gut, wenn man auch Dateien auf der Commandline editieren kann.
|
||||||
|
|
||||||
|
### Verwenden von Windows Subsystem for Linux Installation Guide for Windows 10
|
||||||
|
|
||||||
|
Das geht wohl auch irgendwie.
|
||||||
|
|
||||||
|
# Hello-World Projekt erstellen
|
||||||
|
|
||||||
|
## Mit git
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
git clone https://git.hilie.de/toptica/docker-compose-workshop.git hello-world
|
||||||
|
git checkout hello-world
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ohne git
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
mkdir hello-world
|
||||||
|
cd hello-world
|
||||||
|
vi docker-compose.yaml # Datei »docker-compose.yaml« erstellen und bearbeiten
|
||||||
|
```
|
||||||
|
|
||||||
|
Inhalt für docker-compose.yaml:
|
||||||
|
``` yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
hello_world:
|
||||||
|
image: alpine:latest
|
||||||
|
command: [/bin/echo, 'Hello world']
|
||||||
|
```
|
||||||
|
|
||||||
|
# Hello-World Projekt ausführen
|
||||||
|
``` bash
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
Folgende Ausgabe sollte erscheinen:
|
||||||
|
``` bash
|
||||||
|
Creating network "hallo-welt_default" with the default driver
|
||||||
|
Pulling hello_world (alpine:latest)...
|
||||||
|
latest: Pulling from library/alpine
|
||||||
|
df20fa9351a1: Pull complete
|
||||||
|
Digest: sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321
|
||||||
|
Status: Downloaded newer image for alpine:latest
|
||||||
|
Creating hallo-welt_hello_world_1 ... done
|
||||||
|
Attaching to hallo-welt_hello_world_1
|
||||||
|
hello_world_1 | Hello world
|
||||||
|
hallo-welt_hello_world_1 exited with code 0
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user