From 3d4692e86e78e22f28f4e4dbe5f117f97588c1c1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Apr 2019 14:25:25 -0400 Subject: comment --- ...ent_2_52ab9e8d56cf7b04be644293f6a30404._comment | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/forum/Getting_Info_from_containers/comment_2_52ab9e8d56cf7b04be644293f6a30404._comment diff --git a/doc/forum/Getting_Info_from_containers/comment_2_52ab9e8d56cf7b04be644293f6a30404._comment b/doc/forum/Getting_Info_from_containers/comment_2_52ab9e8d56cf7b04be644293f6a30404._comment new file mode 100644 index 00000000..bfb1a754 --- /dev/null +++ b/doc/forum/Getting_Info_from_containers/comment_2_52ab9e8d56cf7b04be644293f6a30404._comment @@ -0,0 +1,30 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2019-04-16T18:18:55Z" + content=""" +Sure, look at how `Container` is defined: + + data Container = Container MachineName Chroot.Chroot Host + +Getting a Host out of that is easy. :) + + getContainerHost (Container _ _ h) = h + +(Has to be put inside the Systemd module as it does not export the +Container constructor.) + +That's specific to systemd containers, other container systems +have different data types. Here's the one from the Docker module: + + data Container = Container Image Host + +If you wanted to you could even make a type class that these and other +containers are part of, with a method to extract the Host. I would be happy +to merge such a patch. + +And yeah, this seems like a good way around wanting to get otherwise +unpropigated info out of containers. It's worth noting that the Host +inside a systemd Container has as its hostname the MachineName used +for the container. +"""]] -- cgit v1.2.3