summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/Systemd.hs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs
index 21b66cb8..973314ac 100644
--- a/src/Propellor/Property/Systemd.hs
+++ b/src/Propellor/Property/Systemd.hs
@@ -24,7 +24,9 @@ module Propellor.Property.Systemd (
resolvConfed,
publish,
Proto(..),
- publish'
+ publish',
+ bind,
+ bindRo,
) where
import Propellor
@@ -274,6 +276,8 @@ containerCfg p = RevertableProperty (mk True) (mk False)
('-':_) -> p
_ -> "--" ++ p
+
+
-- | Bind mounts </etc/resolv.conf> from the host into the container.
--
-- This property is enabled by default. Revert it to disable it.
@@ -310,3 +314,14 @@ publish' proto hostport containerport = containerCfg $ "--port=" ++
where
sproto TCP = "tcp"
sproto UDP = "udp"
+
+-- | Bind mount a file or directory from the host into the container.
+--
+-- The parameter can be a FilePath, or a colon-separated pair of
+-- hostpath:containerpath.
+bind :: FilePath -> RevertableProperty
+bind f = containerCfg $ "--bind=" ++ f
+
+-- | Read-only mind mount.
+bindRo :: FilePath -> RevertableProperty
+bindRo f = containerCfg $ "--bind-ro=" ++ f