packages:docker
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
packages:docker [2016-02-09 07:48] – [Network Configuration] glen | packages:docker [2020-10-24 16:21] (current) – add php images link glen | ||
---|---|---|---|
Line 8: | Line 8: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | [[packages: | + | - [[packages: |
+ | - 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 25: | Line 59: | ||
| | ||
- | ===== How To ===== | ||
- | ==== Getting rid of unused images | + | ===== Rights ===== |
- | < | + | Don't run docker |
- | docker | + | |
- | </ | + | |
- | ===== PLD Base image ===== | + | |
- | Simple script | + | <note tip> |
+ | By adding yourself | ||
+ | </ | ||
- | <code bash mkimage-pld.sh> | + | Whoever, we still consider that more secure approach than just running as root. Accidental damage to Host system is minimized this way. |
- | #!/bin/sh | + | ===== How To ===== |
- | set -e | + | |
- | ROOTFS=~/root | + | ==== Maintenance ==== |
- | IMAGE=pld | + | |
- | # to clean up: | + | Getting rid of stopped containers |
- | docker rmi $IMAGE | + | |
- | # build | + | < |
- | rpm -r $ROOTFS | + | docker ps -f status=exited |
+ | docker ps -q -f status=exited | xargs -r docker rm | ||
+ | </ | ||
- | install -d $ROOTFS/ | + | Getting rid of unused images |
- | mknod $ROOTFS/ | + | |
- | mknod $ROOTFS/ | + | |
- | mknod $ROOTFS/ | + | |
- | mknod $ROOTFS/ | + | |
- | mknod $ROOTFS/ | + | |
- | mknod $ROOTFS/ | + | |
- | poldek | + | < |
+ | docker images | ||
+ | docker images | ||
+ | </ | ||
- | # cleanups | + | Getting rid of unused volumes |
- | PKGS=" | + | < |
- | for pkg in $PKGS; do | + | docker volume ls -f dangling=true |
- | rpm -r $ROOTFS -q $pkg && rpm -r $ROOTFS -e $pkg --nodeps | + | docker volume ls -qf dangling=true |
- | done | + | |
- | + | ||
- | # and import | + | |
- | tar -C $ROOTFS -cf- . | docker import | + | |
- | + | ||
- | # and test | + | |
- | docker | + | |
</ | </ | ||
- | <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 [[people: | + | |
- | <code bash> | + | |
- | vagrant@pld64 ~$ sudo docker run -i -t glen/pld bash | + | |
- | root@ae0aac5de155 ~# | + | |
- | </ | + | |
===== Vagrant ===== | ===== Vagrant ===== |
packages/docker.1455000500.txt.gz · Last modified: 2016-02-09 07:48 by glen