Add Docker environment property which allows to specify environment variables to containers.

This commit is contained in:
Antoine Eiche 2015-06-03 17:50:12 +02:00 committed by Joey Hess
parent fd9d172bcd
commit e1f2d4a8f1
1 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,7 @@ module Propellor.Property.Docker (
memory,
cpuShares,
link,
environment,
ContainerAlias,
restartAlways,
restartOnFailure,
@ -348,6 +349,11 @@ restartOnFailure (Just n) = runProp "restart" ("on-failure:" ++ show n)
restartNever :: Property HasInfo
restartNever = runProp "restart" "no"
-- | Set environment variable with a tuple composed by the environment
-- variable name and its value.
environment :: (String, String) -> Property HasInfo
environment (k, v) = runProp "env" $ k ++ "=" ++ v
-- | A container is identified by its name, and the host
-- on which it's deployed.
data ContainerId = ContainerId