{"id":21745150,"url":"https://github.com/zuazo/specinfra-backend-docker_compose","last_synced_at":"2025-04-13T05:12:23.654Z","repository":{"id":56896571,"uuid":"49187638","full_name":"zuazo/specinfra-backend-docker_compose","owner":"zuazo","description":"Serverspec / Specinfra backend for Docker Compose.","archived":false,"fork":false,"pushed_at":"2016-01-08T06:26:12.000Z","size":32,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T22:05:10.506Z","etag":null,"topics":["backend","devops","docker","docker-compose","security","specinfra","specinfra-backend","tdd","testing"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/specinfra-backend-docker_compose","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zuazo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-07T07:04:24.000Z","updated_at":"2019-07-31T21:56:45.000Z","dependencies_parsed_at":"2022-08-20T17:10:32.590Z","dependency_job_id":null,"html_url":"https://github.com/zuazo/specinfra-backend-docker_compose","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fspecinfra-backend-docker_compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fspecinfra-backend-docker_compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fspecinfra-backend-docker_compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuazo%2Fspecinfra-backend-docker_compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuazo","download_url":"https://codeload.github.com/zuazo/specinfra-backend-docker_compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665743,"owners_count":21142123,"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","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":["backend","devops","docker","docker-compose","security","specinfra","specinfra-backend","tdd","testing"],"created_at":"2024-11-26T07:13:46.563Z","updated_at":"2025-04-13T05:12:23.629Z","avatar_url":"https://github.com/zuazo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Specinfra Docker Compose Backend\n[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg?style=flat)](http://www.rubydoc.info/gems/specinfra-backend-docker_compose)\n[![GitHub](http://img.shields.io/badge/github-z/specinfra--backend--docker__compose-blue.svg?style=flat)](https://github.com/zuazo/specinfra-backend-docker_compose)\n[![License](https://img.shields.io/github/license/zuazo/specinfra-backend-docker_compose.svg?style=flat)](#license-and-author)\n\n[![Gem Version](https://badge.fury.io/rb/specinfra-backend-docker_compose.svg)](https://rubygems.org/gems/specinfra-backend-docker_compose)\n[![Dependency Status](http://img.shields.io/gemnasium/zuazo/specinfra-backend-docker_compose.svg?style=flat)](https://gemnasium.com/zuazo/specinfra-backend-docker_compose)\n[![Code Climate](http://img.shields.io/codeclimate/github/zuazo/specinfra-backend-docker_compose.svg?style=flat)](https://codeclimate.com/github/zuazo/specinfra-backend-docker_compose)\n[![Travis CI Build Status](http://img.shields.io/travis/zuazo/specinfra-backend-docker_compose.svg?style=flat)](https://travis-ci.org/zuazo/specinfra-backend-docker_compose)\n[![Circle CI Build Status](https://circleci.com/gh/zuazo/specinfra-backend-docker_compose/tree/master.svg?style=shield)](https://circleci.com/gh/zuazo/specinfra-backend-docker_compose/tree/master)\n[![Coverage Status](http://img.shields.io/coveralls/zuazo/specinfra-backend-docker_compose.svg?style=flat)](https://coveralls.io/r/zuazo/specinfra-backend-docker_compose?branch=master)\n[![Inline docs](http://inch-ci.org/github/zuazo/specinfra-backend-docker_compose.svg?branch=master\u0026style=flat)](http://inch-ci.org/github/zuazo/specinfra-backend-docker_compose)\n\n[Serverspec](http://serverspec.org/) / [Specinfra](https://github.com/mizzy/specinfra) backend for [Docker Compose](https://docs.docker.com/compose/).\n\n## Requirements\n\n* Recommended Docker `1.7.0` or higher.\n* Docker Compose\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\n# Gemfile\n\ngem 'specinfra-backend-docker_compose', '~\u003e 0.1.0'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install specinfra-backend-docker_compose\n\n## Usage\n\nCreate the [Docker Compose configuration](https://docs.docker.com/v1.8/compose/yml/) to test:\n\n```yaml\n# docker-compose.yml\n\nweb:\n  build: .\n  links:\n  - db:mysql\n  ports:\n  - 8080:80\n\ndb:\n  image: mariadb\n  environment:\n  - MYSQL_ROOT_PASSWORD=example\n```\n\nAnd a file example with some Serverspec tests:\n\n```ruby\n# web_test_spec.rb\n\nrequire 'serverspec'\nrequire 'specinfra/backend/docker_compose'\n\nset :docker_compose_file, './docker-compose.yml'\nset :docker_compose_container, :web # The compose container to test\nset :docker_wait, 15 # wait 15 seconds before running the tests\nset :backend, :docker_compose\n\ndescribe 'docker-compose.yml run' do\n  describe service('httpd') do\n    it { should be_enabled }\n    it { should be_running }\n  end\nend\n```\n\nTo run the tests:\n\n    $ rspec web_test_spec.rb\n\n## Configuration\n\nUses the following `Specinfra` configuration options:\n\n- `:docker_compose_file`: Docker Compose configuration file path (**required**).\n- `:docker_compose_container`: The name of the container you want to test (**required**). Only one can be tested.\n- `:docker_wait`: Seconds to wait for containers to start (i.e., time to sleep before running the tests) (**recommended**).\n- `:backend`: `:docker_compose` or `:docker_compose_lxc` (for LXC execution driver). Always set it after all other options.\n\nKeep in mind that some CI environments may be somewhat slower than usual. So maybe you will need to increase the `:docker_wait` value to one or two minutes to allow more time for services to start.\n\nSome options used only by the `:docker_compose_lxc` backend:\n\n- `:sudo_options`: Sudo command argument list as string or as array.\n- `:sudo_path`: Sudo binary directory.\n- `:sudo_password`\n- `:disable_sudo`: whether to disable Sudo (enabled by default).\n\nFor example:\n\n```ruby\nset :sudo_password, '0deH3R7RbHoEwzIqQGCD'\n```\n\n## Important Warning\n\nThis backend uses the [`docker-compose-api`](https://rubygems.org/gems/docker-compose-api) Ruby gem to emulate Docker Compose. So, some *docker-compose.yml* configuration options may not be supported yet or may not work exactly the same. Let us know if you find any bug or you need a missing feature.\n\nThanks to [Mauricio Klein](https://github.com/mauricioklein) for all his work by the way!\n\n## Testing\n\nSee [TESTING.md](https://github.com/zuazo/specinfra-backend-docker_compose/blob/master/TESTING.md).\n\n## Contributing\n\nPlease do not hesitate to [open an issue](https://github.com/zuazo/specinfra-backend-docker_compose/issues/new) with any questions or problems.\n\nSee [CONTRIBUTING.md](https://github.com/zuazo/specinfra-backend-docker_compose/blob/master/CONTRIBUTING.md).\n\n## TODO\n\nSee [TODO.md](https://github.com/zuazo/specinfra-backend-docker_compose/blob/master/TODO.md).\n\n## License and Author\n\n|                      |                                          |\n|:---------------------|:-----------------------------------------|\n| **Author:**          | [Xabier de Zuazo](https://github.com/zuazo) (\u003cxabier@zuazo.org\u003e)\n| **Copyright:**       | Copyright (c) 2016 Xabier de Zuazo\n| **License:**         | Apache License, Version 2.0\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n        http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuazo%2Fspecinfra-backend-docker_compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuazo%2Fspecinfra-backend-docker_compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuazo%2Fspecinfra-backend-docker_compose/lists"}