Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
|
admin_grundlagen:docker:volumes [2026/05/30 22:35] ingo_wichmann gelöscht |
admin_grundlagen:docker:volumes [2026/05/30 23:15] (aktuell) ingo_wichmann |
||
|---|---|---|---|
| Zeile 3: | Zeile 3: | ||
| git installieren: | git installieren: | ||
| + | apt install -y git | ||
| + | ++++ RockyLinux | | ||
| dnf install -y git | dnf install -y git | ||
| + | ++++ | ||
| Quellcode laden: | Quellcode laden: | ||
| Zeile 16: | Zeile 19: | ||
| Image bauen: | Image bauen: | ||
| - | podman build -t='ingo/routes-explorer:0.0.1' . | + | docker build -t='ingo/routes-explorer:0.0.1' . |
| ===== CLI ===== | ===== CLI ===== | ||
| - | ==== nicht persistent ==== | + | ==== ohne Volume ==== |
| Container starten: | Container starten: | ||
| - | podman container run -d -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.1 | + | docker container run -d -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.1 |
| GPX-Tracks aussuchen und herunterladen: https://wildnis-wandern.de/gpx-downloads/ | GPX-Tracks aussuchen und herunterladen: https://wildnis-wandern.de/gpx-downloads/ | ||
| Zeile 33: | Zeile 36: | ||
| LABEL version="0.0.2" | LABEL version="0.0.2" | ||
| </file> | </file> | ||
| - | podman build -t='ingo/routes-explorer:0.0.2' . | + | docker build -t='ingo/routes-explorer:0.0.2' . |
| + | ++++ Podman | | ||
| podman container run -d --replace -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.2 | podman container run -d --replace -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.2 | ||
| + | ++++ | ||
| + | docker container rm -f routes-explorer | ||
| + | docker container run -d -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.2 | ||
| http://localhost:5000 | http://localhost:5000 | ||
| -> GPX-Dateien sind weg | -> GPX-Dateien sind weg | ||
| + | ==== anonymes Volume ==== | ||
| ==== relativer Pfad ==== | ==== relativer Pfad ==== | ||
| Container löschen: | Container löschen: | ||
| - | podman container rm -f routes-explorer | + | docker container rm -f routes-explorer |
| Daten im Verzeichnis ''routes'' speichern: | Daten im Verzeichnis ''routes'' speichern: | ||
| mkdir routes | mkdir routes | ||
| + | ++++ Podman mit SELinux | | ||
| podman container run -d --restart=always -v ./routes:/routes:Z -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.1 | podman container run -d --restart=always -v ./routes:/routes:Z -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.1 | ||
| + | ++++ | ||
| + | docker container run -d --restart=always -v ./routes:/routes: -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.1 | ||
| http://localhost:5000 | http://localhost:5000 | ||
| Zeile 53: | Zeile 64: | ||
| Container updaten: | Container updaten: | ||
| + | ++++ Podman | | ||
| podman container run -d --replace --restart=always -v ./routes:/routes:Z -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.2 | podman container run -d --replace --restart=always -v ./routes:/routes:Z -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.2 | ||
| + | ++++ | ||
| + | docker container rm -f routes-explorer | ||
| + | docker container run -d --replace --restart=always -v ./routes:/routes: -p 5000:5000 -e ROUTES_FOLDER=/routes --name routes-explorer ingo/routes-explorer:0.0.2 | ||
| http://localhost:5000 | http://localhost:5000 | ||
| -> GPX-Dateien sind noch da | -> GPX-Dateien sind noch da | ||
| + | |||
| + | docker inspect routes-explorer --format json | jq '.[0].Mounts' | ||
| + | -> relativer Pfad wird von Docker als absoluter Pfad verarbeitet. | ||
| + | |||
| + | === Sicherheit === | ||
| + | container exec -it routes-explorer bash | ||
| + | cp /usr/bin/cat /routes | ||
| + | chmod u+sx,go+x /routes/cat | ||
| + | ls -l /routes/cat | ||
| + | exit | ||
| + | ls -l ./routes/cat | ||
| + | ==== benanntes Volume ==== | ||