docker haddock

This commit is contained in:
Joey Hess 2014-05-31 21:44:50 -04:00
parent 31d9dd297d
commit b0f2478bcb
1 changed files with 14 additions and 10 deletions

View File

@ -6,13 +6,14 @@
-- which propellor can set up. See config.hs for an example. -- which propellor can set up. See config.hs for an example.
module Propellor.Property.Docker ( module Propellor.Property.Docker (
Image, -- * Host properties
ContainerName,
configured,
installed, installed,
configured,
container, container,
docked, docked,
garbageCollected, garbageCollected,
Image,
ContainerName,
-- * Container configuration -- * Container configuration
dns, dns,
hostname, hostname,
@ -25,6 +26,7 @@ module Propellor.Property.Docker (
workdir, workdir,
memory, memory,
link, link,
ContainerAlias,
-- * Internal use -- * Internal use
chain, chain,
) where ) where
@ -45,17 +47,17 @@ import Data.List
import Data.List.Utils import Data.List.Utils
import qualified Data.Set as S import qualified Data.Set as S
installed :: Property
installed = Apt.installed ["docker.io"]
-- | Configures docker with an authentication file, so that images can be -- | Configures docker with an authentication file, so that images can be
-- pushed to index.docker.io. -- pushed to index.docker.io. Optional.
configured :: Property configured :: Property
configured = property "docker configured" go `requires` installed configured = property "docker configured" go `requires` installed
where where
go = withPrivData DockerAuthentication $ \cfg -> ensureProperty $ go = withPrivData DockerAuthentication $ \cfg -> ensureProperty $
"/root/.dockercfg" `File.hasContent` (lines cfg) "/root/.dockercfg" `File.hasContent` (lines cfg)
installed :: Property
installed = Apt.installed ["docker.io"]
-- | A short descriptive name for a container. -- | A short descriptive name for a container.
-- Should not contain whitespace or other unusual characters, -- Should not contain whitespace or other unusual characters,
-- only [a-zA-Z0-9_-] are allowed -- only [a-zA-Z0-9_-] are allowed
@ -76,9 +78,11 @@ container cn image = Host hn [] attr
cn2hn :: ContainerName -> HostName cn2hn :: ContainerName -> HostName
cn2hn cn = cn ++ ".docker" cn2hn cn = cn ++ ".docker"
-- | Ensures that a docker container is set up and running. The container -- | Ensures that a docker container is set up and running, finding
-- has its own Properties which are handled by running propellor -- its configuration in the passed list of hosts.
-- inside the container. --
-- The container has its own Properties which are handled by running
-- propellor inside the container.
-- --
-- Additionally, the container can have DNS attributes, such as a CNAME. -- Additionally, the container can have DNS attributes, such as a CNAME.
-- These become attributes of the host(s) it's docked in. -- These become attributes of the host(s) it's docked in.