Docker

Ziel ist es, die aktuelle Infrastruktur mit Docker zu realisieren.

Hier werden in Zukunft alle Containervorbereitungen gesammelt für die verschiedenen Dienste, die auch anderen Menschen nützlich sein könnten.

Meine Dockerfiles

Dokumentation

Notizen

FIXME

Installation

Docker 1.8.x

Ubuntu 15.10 ships Docker 1.6.x; for 1.8 do: https://docs.docker.com/installation/ubuntulinux/

Best practices

Data containers

* https://medium.com/@ramangupta/why-docker-data-containers-are-good-589b3c6c749e * http://stackoverflow.com/questions/18496940/how-to-deal-with-persistent-storage-e-g-databases-in-docker/20652410#20652410 * https://groups.google.com/forum/#!msg/docker-user/EUndR1W5EBo/JxcsbqIqfQQJ * http://stackoverflow.com/questions/23544282/what-is-the-best-way-to-manage-permissions-for-docker-shared-volumes * http://docs.docker.com/userguide/dockervolumes/

Instead of using data containers one can also create for example a /data inside the Dockerfile and then chown/chmod file permissions to that directory. When a volume is then attached to /data it will have the needed permissions…

Manage containers

Remove containers

docker ps -a | grep ‘weeks ago’ | awk ‘{print $1}’ | xargs –no-run-if-empty docker rm

(Source: http://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers)

Remove untagged images

sudo docker images | grep “<none>” | awk ‘{print $3}’ | xargs –no-run-if-empty docker rmi

(Source: http://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers)

Services to dockerize

* Taskserver for Taskwarrior http://www.deimeke.net/dirk/blog/index.php?/archives/3637-Taskserver-auf-CentOS-6-....html * Websites * simple murmur management interface * Done: Mumble-Moderator * Done: Mumble-Server * Done: Mumble-CVP (https://github.com/Natenom/murmur-cvp)

Volumes and permissions

On the docker host: * mkdir /docker-data/volume1 * chown 1000:1000 /docker-data/volume1

Inside the container (Dockerfile): * useradd uid=1000 gid=1000 * RUN the rest as this user

Permissions should work now :)

Both uids and gids on the docker host and inside an container must match; the guid/uid on the host can be any, no user must exist with these ids.

Zuletzt geändert 2022-03-29 05:03:36 +0200 CEST durch Natenom (init, 1c39149)