9 ms·
How would you use this to build a docker container within a docker container? This would be an interesting use case for continuous integration where you might h
by gravypod 8y ago
How would you use this to build a docker container within a docker container? This would be an interesting use case for continuous integration where you might have ephemeral building workers.
- dlor 8y agoCheck out kaniko, we built it for that exact use case: github.com/GoogleContainerTools/kaniko
- ihucos 8y agoI think the simplest would be like this: ihucos@macbook:~$ docker run --privileged --volume /var/lib/plash -ti python bash root@d2a59ae96bc2:/# pip3 install plash Collecting plash Downloading https://files.pythonhosted.org/packages/41/9a/a3a7c6fd104ff197b7656a51e1b396eee42bde3a578d70eb1c5d524e8e0f/plash-1.1359-py3-none-any.whl (749kB) 100% || 757kB 2.0MB/s Installing collected packages: plash Successfully installed plash-1.1359 root@d2a59ae96bc2:/# plash init root@d2a59ae96bc2:/# plash -A plash: fetching 100% plash: extracting... d2a59ae96bc2:/# type apk apk is /sbin/apk d2a59ae96bc2:/# printf hello from alpine hellod2a59ae96bc2:/# root@d2a59ae96bc2:/# exit exit ohh yeah, you would need to save to builded container somewhere or pipe it out from docker (but docker does not differentiate stderr and stdout). In any case to import the container builded with plash back to the docker: ihucos@macbook:~$ plash export-tar --eval-file /tmp/plashscript | docker import - + touch /hello --: sha256:8e26d9d222bb4840feb3aeb475522e76aa8fa835049eac08121961694203e99e