packages:docker
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
packages:docker [2015-04-09 16:55] – [Docker] add Prerequisites glen | packages:docker [2020-10-24 16:21] (current) – add php images link glen | ||
---|---|---|---|
Line 3: | Line 3: | ||
[[https:// | [[https:// | ||
- | Have look at Docker [[https://www.docker.io/gettingstarted/|getting started]]. | + | Have look at Docker [[https://docs.docker.com/linux/|getting started]]. |
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | [[docs:lxc# | + | - [[packages:kernel]] with '' |
+ | - vserver patch disabled ('' | ||
+ | - https:// | ||
+ | - http:// | ||
+ | |||
+ | ===== PLD Linux Base images ===== | ||
+ | |||
+ | Minimal PLD Linux base images are built every Friday and published in GitLab: | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | There' | ||
+ | * https:// | ||
+ | |||
+ | < | ||
+ | $ docker run --rm -it registry.gitlab.com/ | ||
+ | hello pld linux | ||
+ | </ | ||
+ | |||
+ | To build your own base image, you can use [[https:// | ||
+ | |||
+ | |||
+ | Additionally PHP base images are provided: | ||
+ | * https:// | ||
+ | |||
+ | ==== Setup Cgroups ==== | ||
+ | |||
+ | Easiest way is to install [[package> | ||
+ | |||
+ | < | ||
+ | # install libcgroup and enable mounts | ||
+ | poldek -u --noask libcgroup | ||
+ | sed -i -e '/ | ||
+ | service cgconfig start | ||
+ | </ | ||
===== Network Configuration ===== | ===== Network Configuration ===== | ||
Line 23: | Line 57: | ||
Or, to enable it more permanently, | Or, to enable it more permanently, | ||
- | | + | net.ipv4.ip_forward=1 |
- | ===== PLD Base image ===== | + | ===== Rights |
- | Simple script | + | Don't run docker as '' |
- | <code bash mkimage-pld.sh> | + | <note tip> |
- | #!/bin/sh | + | By adding yourself to the docker group you are effectively granting yourself full root permissions. For more information please read [[https://www.andreas-jung.com/ |
- | set -e | + | </ |
- | ROOTFS=~/root | + | Whoever, we still consider that more secure approach than just running as root. Accidental damage to Host system is minimized this way. |
- | IMAGE=pld | + | ===== How To ===== |
- | # to clean up: | + | ==== Maintenance ==== |
- | docker rmi $IMAGE | + | |
- | # build | + | Getting rid of stopped containers |
- | rpm -r $ROOTFS --initdb | + | |
- | install -d $ROOTFS/ | + | < |
- | mknod $ROOTFS/ | + | docker ps -f status=exited |
- | mknod $ROOTFS/ | + | docker ps -q -f status=exited | xargs -r docker rm |
- | mknod $ROOTFS/ | + | </code> |
- | mknod $ROOTFS/ | + | |
- | mknod $ROOTFS/dev/zero c 1 5 -m 666 | + | |
- | mknod $ROOTFS/ | + | |
- | poldek -r $ROOTFS --up -u bash iproute2 coreutils poldek | + | Getting rid of unused images |
- | # cleanups | + | < |
- | PKGS=" | + | docker images |
- | for pkg in $PKGS; do | + | docker images |
- | rpm -r $ROOTFS | + | </ |
- | done | + | |
- | + | ||
- | # and import | + | |
- | tar -C $ROOTFS -cf- . | docker import - $IMAGE | + | |
- | # and test | + | Getting rid of unused volumes |
- | docker | + | < |
+ | docker | ||
+ | docker volume ls -qf dangling=true | xargs -r docker volume rm | ||
</ | </ | ||
- | <file> | + | For Docker |
- | # sh -x /vagrant/mkimage-pld.sh | + | |
- | + rpm -r /home/vagrant/ | + | |
- | + poldek -r root --up -u bash iproute2 | + | |
- | + docker | + | |
- | # docker run -i -t pld bash | + | |
- | WARNING: IPv4 forwarding is disabled. | + | |
- | [root@e8d2bb1215c2 /]# id | + | |
- | uid=0(root) gid=0(root) groups=0(root) | + | |
- | </ | + | |
- | You can see more available samples in [[https:// | + | For Docker >= 1.13 use '' |
- | + | ||
- | also, you can try [[.: | + | |
- | <code bash> | + | |
- | vagrant@pld64 ~$ sudo docker run -i -t glen/pld bash | + | |
- | root@ae0aac5de155 ~# | + | |
- | </ | + | |
===== Vagrant ===== | ===== Vagrant ===== |
packages/docker.1428591352.txt.gz · Last modified: 2015-04-09 16:55 by glen