Live data from Hacker News

Show HN: Plash – Build and run containers

github.com

11–20 of 31 posts

Re: Show HN: Plash – Build and run containers

#11
post #4

Are there any plans to be backwards-compatible with Dockerfiles and ‘docker-build’?

Good morning,

it certainly would be very nice. I explored this a little bit but on the end had to focus on stability of the core components. It wouldn't be anything too hard, but quite a lot of work to implement all the syntax quirks, keeping up with new commands, etc. So right now at least I personally don't have concrete plans to implement it. What you can do right now is use images from a local docker installation:

$ plash --from-docker busybox -- printf hi

Re: Show HN: Plash – Build and run containers

#12
post #2

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.

I 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

Re: Show HN: Plash – Build and run containers

#13

Some comparisons between the cli of plash and equivalent commands in docker (only because I'm already familiar with it) would be pretty helpful.

Yep true. I am still trying to figure out how to write good documentation/tutorials. I will definitely write some general recipes in the README for common tasks, some also doable in other container software like mounting containers, importing from docker, exporting to docker, using an image published in github etc. I'll shortly ping you via PM afterwards.

Re: Show HN: Plash – Build and run containers

#14

Will this run alongside virtual box? (In other words, does it need hyper-V turned on on a windows box?

Hey,

Yeah, that should work. It usually uses linux namespaces/overlay/unionfs/mount/chroot there are no dependencies on hyper-V.

In the worst case scenario plash would also be happy with not cleaning up mountpoints (PLASH_NO_UNSHARE=1) and using unionfs-fuse. During development I run it on FreeBSD and macOS. So its quite portable. Feel free to send me an mail (mail at irae me) for support.

EDIT: Running it natively on a non Linux-System is probably not what you think, since you can't run a linux root file system for example on top of the macOS kernel. Experimenting with the FreeBSD linux abi emulation layer did not yield usable results for me.

Re: Show HN: Plash – Build and run containers

#15

How is this different from gVisor? Not complaining, this looks very awesome. I am just interested. This is going to be a great world when we have arbitrary nesting of containers, finally we will have closure :) I think "docker compose" is a big lie.

gVisor is primarly focused on isolation, plash actually only wants to containerize processes and leaves optional isolation to other tools if required (potentially gVisor).

To quote gVisor:

  Containers are not a sandbox. While containers have revolutionized how we develop, package, and deploy applications, running untrusted or potentially malicious code without additional isolation is not a good idea.
I think the approach gVisor uses is basically the same that is used to run python on Googles web hosting platform. As I understand it, with gVisor a process does not directly talk to the kernel but actually to another process.

> This is going to be a great world when we have arbitrary nesting of containers, finally we will have closure :)

Yep. With plash you can do that (In plash unprivileged containers inside unprivileged containers also works, but may need some looking into it).

> I think "docker compose" is a big lie.

I also have strong feelings about docker compose. It's really reinventing everything but now for containers. With plash you can just use supervisord, the init of your operating system and other established means of managing background processes.

Re: Show HN: Plash – Build and run containers

#16
post #6

I find the first item in the README a bit misleading: Security: plash containers run completely unprivileged. What this actually means is that plash containers run as the current user, so not as root. But they provide no isolation whatsoever, which I would expect from containers (and which Docker provides, to a certain extent). The README does mention this, but only much later: - Plash processes have the same operati…

https://github.com/projectatomic/bubblewrap This is the most promising one I've seen.

That's what opam (ocaml package manager) uses for linux sandboxing

Re: Show HN: Plash – Build and run containers

#17
post #6

I find the first item in the README a bit misleading: Security: plash containers run completely unprivileged. What this actually means is that plash containers run as the current user, so not as root. But they provide no isolation whatsoever, which I would expect from containers (and which Docker provides, to a certain extent). The README does mention this, but only much later: - Plash processes have the same operati…

Oh boy, I am since one hour thinking about how to formulate it so its really crystal clear, maybe someone have a suggestion.

In my head isolation and containerization are two completely different problems. If you really want "complete" isolation in plash you'd just had to setuid/setgid/setgroups away from the namespaced root user. Then as far as the kernel is concerned you would be a different user and if you are the only process with this uid you are completely isolated. Maybe I'll add an flag for that.

EDIT:

I am not happy with it at all but changed it:

  - Security: Traditional per user isolation. Containers run completely unprivileged.
Containerisation and sandboxing are two different things. Sandboxing in major container software is fundamentally broken !111

Re: Show HN: Plash – Build and run containers

#18

Earlier quoted context omitted.

https://github.com/projectatomic/bubblewrap This is the most promising one I've seen.

I'm unclear on their readme. Right at the bottom, they seem to suggest that once runC implements rootless containers, it will be a superior solution since it conforms to the Open Containers Initiative. Checking runC's GitHub, they merged a rootless container branch into their master branch a year ago. A related blog post says it's now inside Docker so very well used. So does Docker now provide containers that can gua…

> So does Docker now provide containers that can guarantee immunity from (certain) privilege escalation attacks?

In my opinion the isolation mechanism of major container software like docker is flawed and thinking about it gives me headaches. One problem is that you need a daemon running as root. It's better if you don't have to leave the user space at all. To be fair plash relies on fuse and newuidmap/newgidmap which are suid, so there is at least a little bit happening with root access rights. But it's comparably very little and there is nothing self-baked running as root.

There are many details that for me are unclear in docker, one out of the of the tip of my head, is that the usage of a overlay mount is disabled by non-root users (also inside user maps) because the kernel does not want to guarantee that a bogus setup can cause a security issue.

> Would you move to Docker/runC?

Never :-) The whole point of this is to not use Docker/runC. One of the core aspects of plash is that containers should just be normal processes. Processes is an interface that existed since decades, for containers I need to learn a new tool just to kill one or list all that are running (use ps/kill in plash)

Re: Show HN: Plash – Build and run containers

#19
Really cool, I like the documentation on the website - would be nice if the README was actual HTML though.

Does that mean I can build container images within a running container (for example the GitLab-CI) without doing a stunt like docker-in-docker or fakechroot/fakeroot?

What are you using instead of fakeroot? I've seen people like [zwischenzugs][0] using User Namespaces - which makes it impossible to be run within a container. Author also points out that kaniko still requires you to use root, not sure if the situation has changed with gVisor support, at least a related issue [1] hasn't been marked as resolved.

Have you investigated into creating reproducible containers?

Thank you in advance!

[0]: https://zwischenzugs.com/2018/04/23/unprivileged-docker-buil...

[1]: https://github.com/GoogleContainerTools/kaniko/issues/105

Edit: Why the downvote? Am I misunderstanding something?

Re: Show HN: Plash – Build and run containers

#20
post #19

Really cool, I like the documentation on the website - would be nice if the README was actual HTML though. Does that mean I can build container images within a running container (for example the GitLab-CI) without doing a stunt like docker-in-docker or fakechroot/fakeroot? What are you using instead of fakeroot? I've seen people like [zwischenzugs][0] using User Namespaces - which makes it impossible to be run within…

Thank you :-)

> Does that mean I can build container images within a running container (for example the GitLab-CI) without doing a stunt like docker-in-docker or fakechroot/fakeroot?

Sure, plash's unit tests involve building and they run inside a plash instance at travis CI.

I'll have lunch now and then continue with the reply after.

Post reply on HN