{"id":13647589,"url":"https://github.com/marcy-terui/kitchen-docker_cli","last_synced_at":"2025-10-22T21:50:46.160Z","repository":{"id":24804775,"uuid":"28218864","full_name":"marcy-terui/kitchen-docker_cli","owner":"marcy-terui","description":"Docker native CLI driver for Test-Kitchen","archived":false,"fork":false,"pushed_at":"2019-06-19T13:53:22.000Z","size":142,"stargazers_count":24,"open_issues_count":6,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-07T22:07:23.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/kitchen-docker_cli","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcy-terui.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-19T07:20:05.000Z","updated_at":"2023-04-28T00:50:14.000Z","dependencies_parsed_at":"2022-09-08T05:12:13.742Z","dependency_job_id":null,"html_url":"https://github.com/marcy-terui/kitchen-docker_cli","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/marcy-terui/kitchen-docker_cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcy-terui%2Fkitchen-docker_cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcy-terui%2Fkitchen-docker_cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcy-terui%2Fkitchen-docker_cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcy-terui%2Fkitchen-docker_cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcy-terui","download_url":"https://codeload.github.com/marcy-terui/kitchen-docker_cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcy-terui%2Fkitchen-docker_cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280520818,"owners_count":26344438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:03:39.875Z","updated_at":"2025-10-22T21:50:46.106Z","avatar_url":"https://github.com/marcy-terui.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# \u003ca name=\"title\"\u003e\u003c/a\u003e Kitchen::DockerCli\n[![Gem Version](https://badge.fury.io/rb/kitchen-docker_cli.svg)](http://badge.fury.io/rb/kitchen-docker_cli)  \n[![Build Status](https://travis-ci.org/marcy-terui/kitchen-docker_cli.svg?branch=master)](https://travis-ci.org/marcy-terui/kitchen-docker_cli) [![Circle CI](https://circleci.com/gh/marcy-terui/kitchen-docker_cli.svg?style=svg)](https://circleci.com/gh/marcy-terui/kitchen-docker_cli)  \n[![Join the chat at https://gitter.im/marcy-terui/kitchen-docker_cli](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/marcy-terui/kitchen-docker_cli?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nA Test Kitchen Driver(and Transport) for Docker command line interface.\n\nThis plugin is created with only Docker CLI functions.  \nWe can test on the environment that has no extra software such as `sshd`.\n\n## \u003ca name=\"requirements\"\u003e\u003c/a\u003e Requirements\n\n- Test-Kitchen (\u003e= 1.3)\n\n- Docker (\u003e= 1.8)\nThis driver uses `docker exec` and `docker cp` to upload some files to the containers.  \n\n- tar (GNU Tar)\n\n## \u003ca name=\"installation\"\u003e\u003c/a\u003e Installation and Setup\n\n```sh\ngem install kitchen-docker_cli\n```\n\nor put `Gemfile` in your project directory.\n\n```ruby\nsource 'https://rubygems.org'\n\ngem 'kitchen-docker_cli'\n```\n\nand\n\n```sh\nbundle install\n```\n\n## \u003ca name=\"config\"\u003e\u003c/a\u003e Configuration\n\nAt first, put your `.kitchen(.local).yml` like this.\n\n```yml\n---\ndriver:\n  name: docker_cli\n\ntransport:\n  name: docker_cli\n\nplatforms:\n  - name: ubuntu-12.04\n  - name: centos-6.4\n\nsuites:\n  - name: default\n    run_list:\n    attributes:\n```\n\n## Driver Configuration\n\n### image\n\nThe Docker image's path.\n\nThe default value get from `platform.name`.\n\nExamples:\n\n```yml\n  image: marcy/amzn\n```\n\n### platform\n\nThe Docker image's platform.\n\nThe default value get from `platform.name`.\n\nExamples:\n\n```yml\n  platform: centos\n```\n\n### command\n\nThe command to be executed at `docker run`.\n\nThe default value is `sh -c 'while true; do sleep 1d; done;'`.\n\nExamples:\n\n```yml\n  command: /bin/bash\n```\n\n### run_command\n\nAdds `RUN` command(s) to `Dockerfile`.\n\nThe default value is `nil`.\n\nExamples:\n\n```yml\n  run_command:\n    - yum -y install httpd\n    - service httpd start\n```\n\n### environment\n\nAdds `ENV` command(s) to `Dockerfile`.\n\nThe default value is `nil`.\n\nExamples:\n\n```yml\nenvironment:\n  http_proxy: http://proxy.example.com:8080/\n  LANG: ja_JP.UTF-8\n```\n\n### build_context\n\nPass the basedir as the Docker build context: 'docker build \u003coptions\u003e .' Default is 'false'.\n\n### build_pull\n\nSet option `--pull` to the defined value on `docker build`.\n\nThe default value is nil which is currently interpreted as `false` by Docker.\n\n```yml\n  build_pull: true\n```\n\n### no_cache\n\nNot use the cached image on `docker build`.\n\nThe default value is `false`.\n\nExamples:\n\n```yml\n  no_cache: true\n```\n\n### skip_preparation\n\nSkip the automatically preparation in the step to building Docker image.  \n(i.e. Just pulling the image)\n\nThe default value is `false`.\n\nExamples:\n\n```yml\n  skip_preparation: true\n```\n\n### privileged\n\nGive extended privileges to the suite container.\n\nThe default value is `false`.\n\nExamples:\n\n```yml\n  privileged: true\n```\n\n### security_opt\n\nDefine the seccomp security profile to use.\n\nThe default value is `nil`.\n\nExamples:\n\n```yml\n  security_opt: seccomp=unconfined\n```\n\n### container_name\n\nSet the name of container to link other container(s).\n\nExamples:\n\n```yml\n  container_name: web\n```\n\n### instance_container_name\n\nUse instance name to container_name.\n\nThe default value is `false`.\n\nExamples:\n\n```yml\n  instance_container_name: true\n```\n\n\n### destroy_container_name\n\nImprove destroy action when containers have defined names.\n\nWhen enabled, \"kitchen destroy\" will always try to remove suite containers with their name (if defined by container_name or instance_container_name options) in addition to with the id defined in the current state. This allows a clean removal of containers even if the state is corrupted or was removed.\n\nThe default value is `true`.\n\nExamples:\n\n```yml\n  destroy_container_name: false\n```\n\n### network\n\nSet the Network mode for the container.  \n- `bridge`: creates a new network stack for the container on the docker bridge\n- `none`: no networking for this container\n- `container:\u003cname|id\u003e`: reuses another container network stack\n- `host`: use the host network stack inside the container\n\nExamples:\n\n```yml\n  network: host\n```\n\n### hostname\n\nSet hostname to container.\n\nExamples:\n\n```yml\n  hostname: example.local\n```\n\n### instance_host_name\n\nUse instance name to hostname.\n\nThe default value is `false`.\n\nExamples:\n\n```yml\n  instance_host_name: true\n```\n\n### dns\n\nThe IP addresses of your DNS servers.\n\n```yml\n  dns: 8.8.8.8\n```\n\n```yml\n  dns:\n    - 8.8.8.8\n    - 8.8.4.4\n```\n\n### link\n\nSet `container_name`(and alias) of other container(s) that connect from the suite container.\n\nExamples:\n\n```yml\n link: mysql:db\n```\n\n```yml\n  link:\n    - mysql:db\n    - redis:kvs\n```\n\n### publish\n\nPublish a container's port or a range of ports to the host.\n\nThe default value is `nil`.\n\nExamples:\n\n```yml\n  publish: 80\n```\n\n```yml\n  publish:\n    - 80:8080\n    - 22:2222\n```\n\n### publish_all\n\nPublish all exposed ports to the host interfaces.\nThis option used to communicate between some containers.\n\nThe default value is `false`.\n\nExamples:\n\n```yml\n  publish_all: true\n```\n\n### expose\n\nExpose a port or a range of ports from the container without publishing it to your host.\n\nThe default value is `nil`.\n\nExamples:\n\n```yml\n  expose: 80\n```\n\n```yml\n  expose:\n    - 80\n    - 22\n```\n\n### add_host\n\nAdd additional lines to `/etc/hosts`.\n\nExamples:\n\n```yml\n  add_host: myhost:127.0.0.1\n```\n\n```yml\n  add_host:\n    - myhost:127.0.0.1\n    - yourhost:123.123.123.123\n```\n\n### volume\n\nAdds data volume(s) to the container.\n\nExamples:\n\n```yml\n  volume: /data\n```\n\n```yml\n  volume:\n    - /tmp:/tmp\n    - \u003c%= Dir::pwd %\u003e:/var:rw\n```\n\n### volumes_from\n\nMount data volume(s) from other container(s).\n\nExamples:\n\n```yml\n  volumes_from: container_name\n```\n\n```yml\n  volumes_from:\n    - container_a\n    - container_b\n```\n\n### mount\n\nAttach a filesystem mount to the container.\n\nExamples:\n\n```yml\n  mount: type=volume,source=my-volume,destination=/path/in/container\n```\n\n\n### dockerfile\n\nCreate test image using a supplied Dockerfile, instead of the default Dockerfile created.  \nAnd it can be written as ERB template.  \nFor best results, please:  \n  - Ensure Package Repositories are updated\n  - Ensure Dockerfile installs sudo, curl, and tar\n  - If Ubuntu/Debian, Set DEBIAN_FRONTEND to noninteractive\n\n```yml\n  dockerfile: my/dockerfile\n```\n\n### dockerfile_vars\n\nTemplate variables for the custom Dockerfile.\n\nExample:\n\n- .kitchen.yml\n\n```yml\ndriver:\n  image: marcy/hoge\n  dockerfile: dockerfile.erb\n  dockerfile_vars:\n    envs:\n      LANG: ja_JP.UTF-8\n    cmds:\n      - yum -y install httpd\n```\n\n- dockerfile.erb\n\n```erb\nFROM \u003c%= config[:image] %\u003e\n\u003c% @envs.each do |k,v| %\u003e\nENV \u003c%= k %\u003e \u003c%= v %\u003e\n\u003c% end %\u003e\n\u003c% @cmds.each do |c| %\u003e\nRUN \u003c%= c %\u003e\n\u003c% end %\u003e\n```\n\n- Result\n\n```\nFROM marcy/hoge\nENV LANG ja_JP.UTF-8\nRUN yum -y install httpd\n```\n\n### memory_limit\n\nConstrain the memory available.\n\n```yml\n  memory_limit: 256m\n```\n\n### cpu_shares\n\nChange the priority of CPU Time.  \nThis option with value 0 indicates that the running container has access to all 1024 (default) CPU shares.\n\n```yml\n  cpu_shares: 512\n```\n\n## Transport Configuration\n\n### lxc_driver\n\nIf you use the LXC Driver of Docker (CircleCI), please set `true`  \n\nThe default value is `false`\n\n```yml\n  lxc_driver: true\n```\n\n### docker_base\n\nBase of `docker` command.\n\nThe default value is `docker`\n\nExample:\n\n```yml\n  docker_base: sudo /path/to/docker\n```\n\n### lxc_attach_base\n\nBase of `lxc-attach` command.  \nThis option is used on LXC driver only.\n\nThe default value is `sudo lxc-attach`\n\nExample:\n\n```yml\n  docker_base: sudo /path/to/lxc-attach\n```\n\n### lxc_console_base\n\nBase of `lxc-console` command.  \nThis option is used on LXC driver only.\n\nThe default value is `sudo lxc-console`\n\nExample:\n\n```yml\n  docker_base: sudo /path/to/lxc-console\n```\n\n### pre_create_command\n\nA script or shell command to run locally prior to creating the\ncontainer.  Used to prep the build environment, e.g. performing a login\nto a private docker repository where the test images are housed.\n\nExample:\n\n```yml\n  pre_create_command: ./path/to/script.sh\n```\n\n### no_docker_cp\n\nIf true, it will not use docker\\_cp to copy files into the container but the\nold classic way of a docker exec \"tar ...\".\n\nThis option can be used as a workaround for this kind of bugs:\nhttps://github.com/moby/moby/issues/38252.\n\nIt is better used in system config than in each cookbook as it is closely\nrelated to the system configuration.\n\n## \u003ca name=\"development\"\u003e\u003c/a\u003e Development\n\n* Source hosted at [GitHub][repo]\n* Report issues/questions/feature requests on [GitHub Issues][issues]\n\nPull requests are very welcome! Make sure your patches are well tested.\nIdeally create a topic branch for every separate change you make. For\nexample:\n\n1. Fork the repo\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## \u003ca name=\"authors\"\u003e\u003c/a\u003e Authors\n\nCreated and maintained by [Masashi Terui][author] (\u003cmarcy9114@gmail.com\u003e)\n\n## \u003ca name=\"license\"\u003e\u003c/a\u003e License\n\nApache 2.0 (see [LICENSE][license])\n\n\n[author]:           https://github.com/marcy-terui\n[issues]:           https://github.com/marcy-terui/kitchen-docker_cli/issues\n[license]:          https://github.com/marcy-terui/kitchen-docker_cli/blob/master/LICENSE\n[repo]:             https://github.com/marcy-terui/kitchen-docker_cli\n[driver_usage]:     http://docs.kitchen-ci.org/drivers/usage\n[chef_omnibus_dl]:  http://www.getchef.com/chef/install/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcy-terui%2Fkitchen-docker_cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcy-terui%2Fkitchen-docker_cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcy-terui%2Fkitchen-docker_cli/lists"}