Re: Relationship between snaps and containers, if any
It seems that the most common way to deploy Docker is by mapping ports out of the private IP addresses into the local host's public IP, which means it's completely analogous to multiple processes in the same host. Even when assigning the docker container to an external IP, a commonly recommended practice is to use -p ::, which means the public IP is sitting on the external host. E.g.: http://stackoverflow.com/questions/26539727/giving-a- docker-container-a-routable-ip-address That also maps exactly to just asking the process bind to the particular IP. On Thu, Jan 26, 2017 at 11:12 AM, Mark Shuttleworthwrote: > > Well, from an *external* point of view, all the docker mysql processes > are the same, on the same port, just with different IP addresses. That's > the very nice property of docker for "hyper-elastic" workloads. I don't > think snaps will be useful in that context, unless snaps find a way to > live inside docker containers, but that's OK since snaps are useful in > other contexts. > > Mark > > -- > Snapcraft mailing list > Snapcraft@lists.snapcraft.io > Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm > an/listinfo/snapcraft > -- gustavo @ http://niemeyer.net -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Relationship between snaps and containers, if any
Thanks Mark, your explanation is clear. But I am also thinking along similar lines to Gustavo's suggestion of running a snap multiple times, and wondering if that is the same as having multiple docker processes. -- Luther On Wednesday, January 25, 2017 10:13 PM, Gustavo Niemeyerwrote: Interesting.. I actually don't see that line between snaps and Docker. Just like you can run "docker run mysql" several times, one may run "mysnap.mysql" several times. In both cases the daemon will be visible to the external world via a separate port of the local host's public IP address. In both cases mysql will be isolated from the local environment by confinement. It's even a bit more convenient to do that using a snap. Easier to manage the process on a systemd unit, for example, since the mysql process will indeed be a child of systemd/etc instead of a child of the docker daemon. On Wed, Jan 25, 2017 at 11:51 AM, Mark Shuttleworth wrote: >The best way to think of this is to know that snaps are GREAT when you >have a precise 1:1 relationship between "machines" and "running >instances". And Docker is GREAT when you want an elastic relationship. >So for example, if you want a MySQL "appliance" on a device, there will >only ever be 1 MySQL instance on that device, you want a snap. If you >want a cluster where there may be 1-many instances of MySQl on each >actual machine or VM, then you want Docker. > >The reason for this is that Docker gives each running process its own IP >address. That's perfect for the hyper-elastic case - each extra MySQSL >is just another IP address to talk to. But if you have a machine where >you already have an IP address and all you want is a MySQL there then a >snap will be easier. > >This is why a snap of the Docker daemon makes such sense - in your >cluster, you want exactly one copy of Docker itself running on each >machine, and that is best pulled in as a snap. That docker process then >manages an arbitrary number of docker processes on each machine. > >Make sense? >Mark > > > > > >-- >Snapcraft mailing list >Snapcraft@lists.snapcraft.io >Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm >an/listinfo/snapcraft > -- gustavo @ http://niemeyer.net -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Relationship between snaps and containers, if any
Interesting.. I actually don't see that line between snaps and Docker. Just like you can run "docker run mysql" several times, one may run "mysnap.mysql" several times. In both cases the daemon will be visible to the external world via a separate port of the local host's public IP address. In both cases mysql will be isolated from the local environment by confinement. It's even a bit more convenient to do that using a snap. Easier to manage the process on a systemd unit, for example, since the mysql process will indeed be a child of systemd/etc instead of a child of the docker daemon. On Wed, Jan 25, 2017 at 11:51 AM, Mark Shuttleworthwrote: > > The best way to think of this is to know that snaps are GREAT when you > have a precise 1:1 relationship between "machines" and "running > instances". And Docker is GREAT when you want an elastic relationship. > So for example, if you want a MySQL "appliance" on a device, there will > only ever be 1 MySQL instance on that device, you want a snap. If you > want a cluster where there may be 1-many instances of MySQl on each > actual machine or VM, then you want Docker. > > The reason for this is that Docker gives each running process its own IP > address. That's perfect for the hyper-elastic case - each extra MySQSL > is just another IP address to talk to. But if you have a machine where > you already have an IP address and all you want is a MySQL there then a > snap will be easier. > > This is why a snap of the Docker daemon makes such sense - in your > cluster, you want exactly one copy of Docker itself running on each > machine, and that is best pulled in as a snap. That docker process then > manages an arbitrary number of docker processes on each machine. > > Make sense? > Mark > > > > > -- > Snapcraft mailing list > Snapcraft@lists.snapcraft.io > Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm > an/listinfo/snapcraft > -- gustavo @ http://niemeyer.net -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Relationship between snaps and containers, if any
The best way to think of this is to know that snaps are GREAT when you have a precise 1:1 relationship between "machines" and "running instances". And Docker is GREAT when you want an elastic relationship. So for example, if you want a MySQL "appliance" on a device, there will only ever be 1 MySQL instance on that device, you want a snap. If you want a cluster where there may be 1-many instances of MySQl on each actual machine or VM, then you want Docker. The reason for this is that Docker gives each running process its own IP address. That's perfect for the hyper-elastic case - each extra MySQSL is just another IP address to talk to. But if you have a machine where you already have an IP address and all you want is a MySQL there then a snap will be easier. This is why a snap of the Docker daemon makes such sense - in your cluster, you want exactly one copy of Docker itself running on each machine, and that is best pulled in as a snap. That docker process then manages an arbitrary number of docker processes on each machine. Make sense? Mark -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Relationship between snaps and containers, if any
Hi Luther! Docker containers and snaps are different but sometimes overlap in solving certain classes of technical problems. For instance, "software distribution" as a broad problem is addressed by both snaps and Docker containers, but with very different implementations. First of all, yes you can run Docker on top of an all-snaps system such as Ubuntu Core, and the Docker snap will also give you a Docker engine runtime on Ubuntu classic. Docker containers and snaps are built on different goals. Snaps will typically look and feel like system or user apps running directly on your regular system: you see them in the process list, they see each other if the sandboxing allows it, they may interact with the screen/USB devices/whatever if permissions allow it etc.. Docker containers feel more like very efficient virtual machines that you connect to, they allow for sandboxing as well – where the whole container is sandboxed – and for resource quotas. On your question of snapping a docker container: yes, you would be able to wrap a Docker image inside a snap which would be a client of the Docker snap. On the top of my head, I can personally think of two main cases where you would want to run containers on top of an all snap system: when your workload is already packaged as a container, or when you want to use the resource limits featured in Docker or LXD (e.g. limit network usage, CPU usage etc.). Cheers, - Loïc Minier On Wed, Jan 25, 2017 at 12:53 AM, Luther Goh Lu Fengwrote: > I seek clarity in understanding how docker containers are different from > snaps. The question originated as I pondered if docker containers are the > equivalent of snaps. Is there a blog post or FAQ somewhere that already > addresses this? > > > I also read this article[1], though dated, mentions docker support in > Snappy, which makes me wonder: > > - the scenarios that I would want to deploy docker containers alongside > snaps > - snapping a docker container. > > Appreciate if someone can enlighten me. Thanks. > > > -- Luther > [1] http://thenewstack.io/snappy-ubuntu-a-new-cloud-os-with- > support-for-docker-in-a-post-shellshock-era/ > > -- > Snapcraft mailing list > Snapcraft@lists.snapcraft.io > Modify settings or unsubscribe at: https://lists.ubuntu.com/ > mailman/listinfo/snapcraft > -- - Loïc -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Relationship between snaps and containers, if any
I seek clarity in understanding how docker containers are different from snaps. The question originated as I pondered if docker containers are the equivalent of snaps. Is there a blog post or FAQ somewhere that already addresses this? I also read this article[1], though dated, mentions docker support in Snappy, which makes me wonder: - the scenarios that I would want to deploy docker containers alongside snaps - snapping a docker container. Appreciate if someone can enlighten me. Thanks. -- Luther [1] http://thenewstack.io/snappy-ubuntu-a-new-cloud-os-with-support-for-docker-in-a-post-shellshock-era/ -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft