grim/convey

Bump the version for release
v0.14.0-alpha3
2018-02-20, Gary Kramlich
166a6d1979fa
Bump the version for release
# Docker
The docker package provides tasks for interacting with docker.
## docker/build Task
A build task will build a docker image.
### Attributes
| Name | Required | Default | Description |
| ---------- | -------- | ------- | ----------- |
| dockerfile | Yes | | The dockerfile to use while building |
| files | | | A list of files that should be made available for the build |
| labels | | | A list of labels to set on the image being built |
| tag | | | The tag to apply to the image |
| tags | | | The list of tags as described above |
| target | | | The name of the target to build in a multi stage dockerfile |
At least one tag must be supplied by either the `tag` or `tags` attribute. If both are
supplied, `tag` is inserted to the front of `tags`.
### Example
build-image:
type: docker/build
dockerfile: Dockerfile
tag: myimage:latest
----
## docker/environment Task
An environment task will read a file with environment variables and make them accessible to your plans.
A file is expected to have lines of the form `variable=value`. Empty lines are ignored. Files are read
from the workspace, so files generated by the plan do not need to be exported in order to be a target
of an environment task. From the other direction, it is necessary to import files on the host if they are
to be read by an environment task.
### Attributes
| Name | Required | Default | Description |
| ---------- | -------- | ------- | ----------- |
| from-file | | | A file that should be read. |
| from-files | | | A list of files that should be read. |
| prefix | | | A prefix to add to each variable read from a file |
At least one file must be supplied by either the `from-file` or `from-files` attributes. If both are supplied,
`from-file` is inserted to the front of `from-files`. If the files being read are a result of environment variable
expansion, the order that the files are read are not guaranteed to be stable (or in the order supplied). Be cautious
of this if the environment files define overlapping variables.
### Example
inject-version:
type: docker/environment
from-file: version.txt
prefix: "APP_"
----
## docker/export Task
An export task copies files from the volume to the host.
### Attributes
| Name | Required | Default | Description |
| ----- | -------- | ------- | ----------- |
| files | Yes | | A single filename or a list of files to copy from the workspace to the host. Files can be specified in one of two forms which can be mixed. The first is `source:destination` and the other is `filename` where filename will be used for both the host and the volume. |
### Examples
export:
type: docker/export
files: filename1
export:
type: docker/export
files:
- logo.png
- binary:binary-linux-x86_64
----
## docker/import Task
An import task copies files from the host to the volume. It has one required attribute named sources. This is a list of files relative to the directory that convey was run from that will be copied into the volume.
### Attributes
| Name | Required | Default | Description |
| ----- | -------- | ------- | ----------- |
| files | Yes | | A single filename or a list of files to copy from the host to the workspace. Files can be specified in one of two forms which can be mixed. The first is `source:destination` and the other is `filename` where filename will be used for both the host and the volume. |
### Examples
import:
type: docker/import
files: filename1
import:
type: docker/import
files:
- Dockerfile
- src:source
----
## docker/login Task
A login task will run docker login to login to a registry.
### Attributes
| Name | Required | Default | Description |
| -------- | -------- | ------- | ----------- |
| username | Yes | | The username to login with. |
| password | Yes | | The password to login with. |
| server | | | The server to login to. If omitted docker hub is used. |
### Example
registry-login:
type: docker/login
username: superuser1
password: abc123
----
## docker/logout Task
A logout task will log you out from a Docker registry.
### Attributes
| Name | Required | Default | Description |
| ------ | -------- | ------- | ----------- |
| server | | | The server to logout from. If omitted docker hub is used. |
### Example
registry-logout:
type: docker/logout
server: registry.my.domain:5000
----
## docker/pull Task
A pull task pulls an image.
### Attributes
| Name | Required | Default | Description |
| ------ | -------- | ------- | ----------- |
| image | | | The name including the tag and registry of the image to pull. |
| images | | | A list of images as described above. |
At least one image must be supplied by either the `image` or `images` attribute. If both are
supplied, `image` is inserted to the front of `images`.
### Example
pull-alpine:
type: docker/pull
image: gliderlabs/alpine:edge
----
## docker/push Task
A push task pushes an image.
### Attributes
| Name | Required | Default | Description |
| ------ | -------- | ------- | ----------- |
| image | | | The name including the tag and registry of the image to push. |
| images | | | A list of images as described above. |
At least one image must be supplied by either the `image` or `images` attribute. If both are
supplied, `image` is inserted to the front of `images`.
### Example
push-image:
type: docker/push
images:
- registry.my.domain:5000/newimage:master-latest
- registry.my.domain:5000/newimage:master-deadbeef
----
## docker/remove Task
A remove task removes an image.
### Attributes
| Name | Required | Default | Description |
| ------ | -------- | ------- | ----------- |
| image | | | The name including the tag and registry of the image to remove. |
| images | | | A list of images as described above. |
| quiet | | false | True if a missing image should not count as a task failure. |
At least one image must be supplied by either the `image` or `images` attribute. If both are
supplied, `image` is inserted to the front of `images`.
### Example
remove-image:
type: docker/remove
images:
- registry.my.domain:5000/newimage:master-latest
- registry.my.domain:5000/newimage:master-deadbeef
----
## docker/run Task
A run task runs an image.
### Attributes
| Name | Required | Default | Description |
| ----------- | -------- | ---------- | ----------- |
| command | | | The command to run in the container. This is only necessary if the image does not provide a command by default. |
| detach | | false | Will run the container in the background allowing other tasks to run. The container will be cleaned up on exit. If the image has a HEALTHCHECK specified in the Dockerfile, convey will wait until it is healthy before proceeding. |
| hostname | | | Will set the --network-alias argument in the docker run command. This is generally only useful to connect to service containers. |
| user | | | The user to run as when executing the script or command inside the container. |
| entrypoint | | | The entrypoint to use for the container. This is only necessary if the image does not provide one by default. |
| environment | | | A list of environment variables to set. The should be specified in a `NAME` or `NAME=VALUE` format. If no value is provided, the value of the variable from the host will be provided if it is available. |
| healthcheck | | | See the HealthCheck attributes below. |
| image | Yes | | The image including the registry and tag to run. |
| labels | | | A list of labels to set on the image being built |
| workdir | | | The working directory to use in the container. |
| workspace | | /workspace | The path inside the container to mount the workspace volume. |
### HealthCheck Attributes
All of these attributes map directory to the `--health` arguments to `docker run`.
| Name | Description |
| -------- | ----------- |
| command | The command to run as the health check. |
| interval | The interval with which to check the health. |
| retries | The number of attempts before giving up. |
| start-period | How long to wait before starting to check the container's health. |
| timeout | How long to wait for a health check to return before aborting. |
### Example
A basic example where the image knows everything to do.
build-golang:
type: docker/run
image: golang:onbuild
A basic example using a standard image to do something else
download-file:
type: docker/run
image: debian:jessie-slim
script:
- wget https://somedomain.tld/file1
- wget https://somedomain.tld/file1.sha256
- sha256sum -c file1.sha256
A more compilicated example waiting for a detached nginx to start
web-server:
type: docker/run
image: nginx:alpine
detach: true
command: wget http://localhost
interval: 1s
----
## docker/tag Task
A tag task will tag an existing image.
### Attributes
| Name | Required | Default | Description |
| ----------- | -------- | ---------- | ----------- |
| source | | | The source image, including registry and tag, to tag. |
| destination | | | The destination tag, including registry and tag, to tag. |
### Example
tag-development:
type: docker/tag
source: registry.my.domain:5000/newimage:latest
destination: registry.my.domain:5000/newimage:development