Sha256: 996be94744c68e0b2107e9d5778767496ded73d58c7ef40fd10023c453874197

Contents?: true

Size: 1.3 KB

Versions: 13

Compression:

Stored size: 1.3 KB

Contents

---
title: Docker Config
---

## General

Kubes builds docker images by calling the docker build commands.  Example:

    kubes docker build

To push:

    kubes docker push

## Deploy

While building the docker image as a separate step can be useful, you can just use the deploy command, and kubes will automatically build the Docker image for you. Example:

    kubes deploy web

If you want to skip the `docker build` phase of the deploy, you can run:

    kubes deploy web --no-build

Also, kubes apply another way to skip the docker build:

    kubes apply web

## Customizing Args

Here are some examples of customizing the docker args.

.kubes/config/docker/args.rb

```ruby
command("build",
  args: ["--quiet"],
)

command("push",
  args: ["--disable-content-trust"],
)
```

## Hooks

Here are some examples of running custom hooks before and after the docker commands.

.kubes/config/docker/hooks.rb

```ruby
before("build",
  execute: "echo 'docker build before hook'",
)

after("push",
  execute: "echo 'docker push before hook'",
)
```

### exit on fail

By default, if the hook commands fail, then terraspace will exit with the original hook error code.  You can change this behavior with the `exit_on_fail` option.

```ruby
before("build"
  execute: "/command/will/fail/but/will/continue",
  exit_on_fail: false,
)
```

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kubes-0.3.5 docs/_docs/config/docker.md
kubes-0.3.4 docs/_docs/config/docker.md
kubes-0.3.3 docs/_docs/config/docker.md
kubes-0.3.2 docs/_docs/config/docker.md
kubes-0.3.1 docs/_docs/config/docker.md
kubes-0.3.0 docs/_docs/config/docker.md
kubes-0.2.6 docs/_docs/config/docker.md
kubes-0.2.5 docs/_docs/config/docker.md
kubes-0.2.4 docs/_docs/config/docker.md
kubes-0.2.3 docs/_docs/config/docker.md
kubes-0.2.2 docs/_docs/config/docker.md
kubes-0.2.1 docs/_docs/config/docker.md
kubes-0.2.0 docs/_docs/config/docker.md