engine: resources: docker: Add a docker container resource

This commit is contained in:
Jonathan Gold
2018-11-26 04:53:10 -05:00
committed by James Shubin
parent 916a92c3d8
commit 51ec91dd16
4 changed files with 661 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ You might want to look at the [generated documentation](https://godoc.org/github
for more up-to-date information about these resources.
* [Augeas](#Augeas): Manipulate files using augeas.
* [Docker](#Docker):[Container](#Container) Manage docker containers.
* [Exec](#Exec): Execute shell commands on the system.
* [File](#File): Manage files and directories.
* [Group](#Group): Manage system groups.
@@ -40,6 +41,22 @@ for more up-to-date information about these resources.
The augeas resource uses [augeas](http://augeas.net/) commands to manipulate
files.
## Docker
### Container
The docker:container resource manages docker containers.
It has the following properties:
* `state`: either `running`, `stopped`, or `removed`
* `image`: docker `image` or `image:tag`
* `cmd`: a command or list of commands to run on the container
* `env`: a list of environment variables, e.g. `["VAR=val",],`
* `ports`: a map of portmappings, e.g. `{"tcp" => {80 => 8080, 443 => 8443,},},`
* `apiversion:` override the host's default docker version, e.g. `"v1.35"`
* `force`: destroy and rebuild the container instead of erroring on wrong image
## Exec
The exec resource can execute commands on your system.