Kitchen::DockerCli
A Test Kitchen Driver for Docker command line interface.
This plugin is created with only Docker CLI functions.
Therefore, we can test with an environment that has no extra software such as sshd
.
Requirements
Docker (>= 1.3)
This driver usesdocker exec
command.tar (GNU Tar)
Installation and Setup
gem install kitchen-docker_cli
or put Gemfile
in your project directory.
source 'https://rubygems.org'
gem 'kitchen-docker_cli'
and
bundle install
If you want to use the kithcen exec
command, should you put Gemfile like this. (as of 25 Dec, 2014)
source 'https://rubygems.org'
gem 'test-kitchen', github: 'test-kitchen/test-kitchen', ref: '237efd17dbcafd0c1334134e3f26b050f2ef49d5'
gem 'kitchen-docker_cli'
Configuration
At first, put your .kithcen(.local).yml
like this.
---
driver:
name: docker_cli
platforms:
- name: ubuntu-12.04
- name: centos-6.4
suites:
- name: default
run_list:
attributes:
image
The Docker image's path.
The default value get from platform.name
.
Examples:
image: marcy/amzn
platform
The Docker image's platform.
The default value get from platform.name
.
Examples:
platform: centos
command
The command to be executed at docker run
.
The default value is sh -c 'while true; do sleep 1d; done;'
.
Examples:
command: /bin/bash
run_command
Adds RUN
command(s) to Dockerfile
.
The default value is nil
.
Examples:
run_command:
- yum -y install httpd
- service httpd start
no_cache
Not use the cached image on docker build
.
The default value is false
.
Examples:
no_cache: true
privileged
Give extended privileges to the suite container.
The default value is false
.
Examples:
privileged: true
container_name
Set the name of container to link other container(s).
Examples:
container_name: web
link
Set container_name
(and alias) of other container(s) that connect from the suite container.
Examples:
link: mysql:db
Examples:
link:
- mysql:db
- redis:kvs
publish_all
Publish all exposed ports to the host interfaces.
This option used to communicate between some containers.
The default value is false
.
Examples:
publish_all: true
volume
Adds data volume(s) to the container.
Examples:
volume: /data
volume:
- /tmp:/tmp
- <%= Dir::pwd %>:/var:rw
Development
- Source hosted at GitHub
- Report issues/questions/feature requests on GitHub Issues
Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:
- Fork the repo
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Authors
Created and maintained by Masashi Terui ([email protected])
License
Apache 2.0 (see LICENSE)