Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
5e82c6211e | |||
6d90966f28 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
data-graphana
|
|
||||||
data-influx
|
|
||||||
data-prometheus
|
|
90
README.md
Normal file
90
README.md
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# Vorraussetzungen
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
### Verwenden einer virtuellen Maschine mit Linux
|
||||||
|
|
||||||
|
Z.B. mit _Virtual Box_ kann ein virtueller Rechner aufgesetzt werden.
|
||||||
|
|
||||||
|
### Verbinden über ssh auf einen Linux-Rechner
|
||||||
|
|
||||||
|
Wer kein eigenes Linux hat, kann sich über ssh mit einem Linux-Rechner verbinden, z.B. mit _Putty_. In diesem Fall ist es gut, wenn man auch Dateien auf der Commandline editieren kann.
|
||||||
|
|
||||||
|
### Verwenden von Windows Subsystem for Linux
|
||||||
|
|
||||||
|
Das geht wohl auch irgendwie, aber nicht besonders gut.
|
||||||
|
|
||||||
|
# Hello-World Projekt erstellen
|
||||||
|
|
||||||
|
## Mit git
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
git clone https://git.hilie.de/toptica/docker-compose-workshop.git hello-world
|
||||||
|
cd 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: hello-world:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
# Hello-World Projekt ausführen
|
||||||
|
``` bash
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
Folgende Ausgabe sollte unter anderem so ähnlich erscheinen:
|
||||||
|
``` bash
|
||||||
|
Recreating dockercompose_hello_world_1 ...
|
||||||
|
Recreating dockercompose_hello_world_1 ... done
|
||||||
|
Attaching to dockercompose_hello_world_1
|
||||||
|
hello_world_1 |
|
||||||
|
hello_world_1 | Hello from Docker!
|
||||||
|
hello_world_1 | This message shows that your installation appears to be working correctly.
|
||||||
|
hello_world_1 |
|
||||||
|
hello_world_1 | To generate this message, Docker took the following steps:
|
||||||
|
hello_world_1 | 1. The Docker client contacted the Docker daemon.
|
||||||
|
hello_world_1 | 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
|
||||||
|
hello_world_1 | (amd64)
|
||||||
|
hello_world_1 | 3. The Docker daemon created a new container from that image which runs the
|
||||||
|
hello_world_1 | executable that produces the output you are currently reading.
|
||||||
|
hello_world_1 | 4. The Docker daemon streamed that output to the Docker client, which sent it
|
||||||
|
hello_world_1 | to your terminal.
|
||||||
|
hello_world_1 |
|
||||||
|
hello_world_1 | To try something more ambitious, you can run an Ubuntu container with:
|
||||||
|
hello_world_1 | $ docker run -it ubuntu bash
|
||||||
|
hello_world_1 |
|
||||||
|
hello_world_1 | Share images, automate workflows, and more with a free Docker ID:
|
||||||
|
hello_world_1 | https://hub.docker.com/
|
||||||
|
hello_world_1 |
|
||||||
|
hello_world_1 | For more examples and ideas, visit:
|
||||||
|
hello_world_1 | https://docs.docker.com/get-started/
|
||||||
|
hello_world_1 |
|
||||||
|
dockercompose_hello_world_1 exited with code 0
|
||||||
|
```
|
@ -1,70 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
grafana:
|
|
||||||
image: grafana/grafana:7.0.0
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 3000:3000
|
|
||||||
volumes:
|
|
||||||
- ./data-graphana:/var/lib/grafana
|
|
||||||
|
|
||||||
prometheus:
|
|
||||||
image: prom/prometheus:latest
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 9090:9090
|
|
||||||
command:
|
|
||||||
- --config.file=/etc/prometheus/prometheus.yml
|
|
||||||
volumes:
|
|
||||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
||||||
- ./data-prometheus:/prometheus
|
|
||||||
depends_on:
|
|
||||||
- cadvisor
|
|
||||||
|
|
||||||
cadvisor:
|
|
||||||
image: gcr.io/google-containers/cadvisor:latest
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 8090:8080
|
|
||||||
volumes:
|
|
||||||
- /:/rootfs:ro
|
|
||||||
- /var/run:/var/run:rw
|
|
||||||
- /sys:/sys:ro
|
|
||||||
- /var/lib/docker/:/var/lib/docker:ro
|
|
||||||
|
|
||||||
nextcloud-exporter:
|
|
||||||
image: xperimental/nextcloud-exporter:v0.2.0
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 9205:9205
|
|
||||||
environment:
|
|
||||||
# - NEXTCLOUD_LISTEN_ADDRESS=":9205"
|
|
||||||
- NEXTCLOUD_SERVERINFO_URL=http://moma:8080
|
|
||||||
- NEXTCLOUD_USERNAME=stefan
|
|
||||||
- NEXTCLOUD_PASSWORD=iwidTs33
|
|
||||||
|
|
||||||
node-exporter:
|
|
||||||
image: prom/node-exporter:v1.0.0
|
|
||||||
ports:
|
|
||||||
- 9100:9100
|
|
||||||
|
|
||||||
# influxdb:
|
|
||||||
# image: influxdb:1.8.0
|
|
||||||
# restart: always
|
|
||||||
# ports:
|
|
||||||
# - 8086:8086
|
|
||||||
# volumes:
|
|
||||||
# - ./data-influx:/var/lib/influxdb
|
|
||||||
# environment:
|
|
||||||
# - INFLUXDB_DB=fritzbox
|
|
||||||
# - INFLUXDB_WRITE_USER=stefan
|
|
||||||
# - INFLUXDB_WRITE_USER_PASSWORD=iwidTs33
|
|
||||||
#
|
|
||||||
# fritzcollectd:
|
|
||||||
# image: gizmoh/fritzcollectd
|
|
||||||
# restart: always
|
|
||||||
# ports:
|
|
||||||
# - 25826:25826
|
|
||||||
# volumes:
|
|
||||||
# - ./fritzcollectd.conf:/etc/collectd/collectd.conf.d/fritz.conf:ro
|
|
@ -1,17 +0,0 @@
|
|||||||
<Plugin network>
|
|
||||||
Server "influxdb" "25826"
|
|
||||||
</Plugin>
|
|
||||||
|
|
||||||
<Plugin python>
|
|
||||||
Import "fritzcollectd"
|
|
||||||
|
|
||||||
<Module fritzcollectd>
|
|
||||||
Address "192.168.0.1"
|
|
||||||
Port 49000
|
|
||||||
User "stefan"
|
|
||||||
Password "j5HTBYWFc3cgcDP_Yf8k"
|
|
||||||
Hostname "FritzBox"
|
|
||||||
Instance "1"
|
|
||||||
Verbose "False"
|
|
||||||
</Module>
|
|
||||||
</Plugin>
|
|
@ -1,14 +0,0 @@
|
|||||||
scrape_configs:
|
|
||||||
- job_name: cadvisor
|
|
||||||
scrape_interval: 10s
|
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- moma:8090
|
|
||||||
- job_name: nextcloud
|
|
||||||
scrape_interval: 90s
|
|
||||||
static_configs:
|
|
||||||
- targets: [moma:9205]
|
|
||||||
- job_name: 'node-exporter'
|
|
||||||
scrape_interval: 90s
|
|
||||||
static_configs:
|
|
||||||
- targets: [moma:9100]
|
|
Loading…
x
Reference in New Issue
Block a user