{"id":15199918,"url":"https://github.com/tiangolo/docker-with-compose","last_synced_at":"2025-10-02T15:30:46.177Z","repository":{"id":28906997,"uuid":"119686064","full_name":"tiangolo/docker-with-compose","owner":"tiangolo","description":"Docker image with Docker Compose installed for CI.","archived":true,"fork":false,"pushed_at":"2023-07-09T12:46:47.000Z","size":44,"stargazers_count":158,"open_issues_count":0,"forks_count":45,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-09-25T01:35:08.111Z","etag":null,"topics":["continuous-integration","docker","docker-compose","docker-image"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiangolo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["tiangolo"]}},"created_at":"2018-01-31T12:45:39.000Z","updated_at":"2024-06-02T17:35:17.000Z","dependencies_parsed_at":"2024-09-19T01:06:26.525Z","dependency_job_id":"c2399e43-5a46-4fbc-b04c-a35fa99aac29","html_url":"https://github.com/tiangolo/docker-with-compose","commit_stats":{"total_commits":59,"total_committers":5,"mean_commits":11.8,"dds":"0.38983050847457623","last_synced_commit":"f15906670bc3b50446201b3391218a830156269e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiangolo%2Fdocker-with-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiangolo%2Fdocker-with-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiangolo%2Fdocker-with-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiangolo%2Fdocker-with-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiangolo","download_url":"https://codeload.github.com/tiangolo/docker-with-compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875832,"owners_count":16554706,"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":["continuous-integration","docker","docker-compose","docker-image"],"created_at":"2024-09-28T02:21:11.418Z","updated_at":"2025-10-02T15:30:40.927Z","avatar_url":"https://github.com/tiangolo.png","language":"Shell","funding_links":["https://github.com/sponsors/tiangolo"],"categories":[],"sub_categories":[],"readme":"## 🚨 DEPRECATION WARNING 🚨\n\nAs [Docker now has `compose` built in](https://github.com/docker-library/docker/pull/361) there's no longer need for this Docker image.\n\nYou should use the official [Docker image](https://hub.docker.com/_/docker/) instead.\n\n---\n\n[![Test](https://github.com/tiangolo/docker-with-compose/workflows/Test/badge.svg)](https://github.com/tiangolo/docker-with-compose/actions?query=workflow%3ATest) [![Deploy](https://github.com/tiangolo/docker-with-compose/workflows/Deploy/badge.svg)](https://github.com/tiangolo/docker-with-compose/actions?query=workflow%3ADeploy)\n\n## Supported tags and respective `Dockerfile` links\n\n* [`latest` _(Dockerfile)_](https://github.com/tiangolo/docker-with-compose/blob/master/Dockerfile)\n\n**Note**: There are [tags for each build date](https://hub.docker.com/r/tiangolo/docker-with-compose/tags). If you need to \"pin\" the Docker image version you use, you can select one of those tags. E.g. `tiangolo/docker-with-compose:2021-09-17`.\n\n# Docker with Docker Compose image\n\n[Docker image](https://hub.docker.com/_/docker/) with [Docker Compose](https://github.com/docker/compose) installed for CI.\n\n## Description\n\nThe main purpose of this image is to help in Continuous Integration environments that need the `docker` binary, the `docker-compose` binary, and possibly require doing other small things, like running shell scripts or notifying some API with `curl`.\n\nIt includes both programs (`docker` and `docker-compose`) and allows to run arbitrary shell scripts (contrary to the official Docker Compose image).\n\nBy not having to install `docker-compose` on top of a `docker:latest` image it can reduce the building time about 10 / 15 seconds in a cloud data center for each build. In environments in where the Internet connection is less good than a cloud provider, the time saved would be more.\n\n**GitHub repo**: \u003chttps://github.com/tiangolo/docker-with-compose\u003e\n\n**Docker Hub image**: \u003chttps://hub.docker.com/r/tiangolo/docker-with-compose/\u003e\n\n## Usage\n\nPull the image:\n\n```console\n$ docker pull tiangolo/docker-with-compose\n```\n\nThen run a container of this image **mounting the Docker sock** as a host volume.\n\nBy mounting the Docker sock as a volume you allow the `docker` client inside of the container to communicate with your Docker (the Docker daemon/service) on your machine directly.\n\nThis way, you can send Docker commands, like pulling, running, or building a new Docker image, from inside this container.\n\nYou might also want to mount a host volume with the files that you need to use.\n\n---\n\nFor example, let's say you have a `Dockerfile` like:\n\n```Dockerfile\nFROM nginx\n\nRUN echo \"Hello World\" \u003e /usr/share/nginx/html/index.html\n```\n\nYou could:\n\n* Mount the local directory containing that `Dockerfile`.\n* Mount the local Docker sock.\n* Build that Nginx image from inside of container running this image.\n\n```console\n$ docker run -v $(pwd):/app -v /var/run/docker.sock:/var/run/docker.sock tiangolo/docker-with-compose sh -c \"cd /app/ \u0026\u0026 docker build -t custom-nginx .\"\n```\n\n## Problem description\n\nThere is an official [Docker image](https://hub.docker.com/_/docker/) that contains the `docker` binary. And there is a [Docker Compose image](https://hub.docker.com/r/docker/compose/).\n\nBut the Docker Compose image has `docker-compose` as the entrypoint.\n\nSo, it's not possible to run other commands on that image, like installing something, e.g. `apt-get install -y curl`.\n\nAnd it's also not possible to run `docker` commands directly, e.g. `docker login -u ci-user -p $CI_JOB_TOKEN $CI_REGISTRY`.\n\nThis image allows running arbitrary commands like shell scripts, `docker` commands and also Docker Compose commands like `docker-compose build` and `docker-compose push`.\n\nAs several Continuous Integration systems allow doing previous steps, like installing packages before running the actual main script, those steps could be used to install Docker Compose. But by downloading and installing Docker Compose every time, the builds would be slower.\n\nFor example, a very simple GitLab CI file `.gitlab-ci.yml` could look like:\n\n```yml\n# Do not use this file example\nimage: docker:latest\n\nbefore_script:\n  - apk add --no-cache py-pip\n  - pip install docker-compose\n  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY\n\nci:\n  script:\n    - docker-compose build\n    - docker-compose up -d\n    - docker-compose exec -T tests run-tests.sh\n    - docker-compose down -v\n    - docker stack deploy -c docker-compose.prod.yml --with-registry-auth prod-example-com\n```\n\nBut when the base image has to download and install Docker Compose every time, that's time added to the process. Specifically the lines in:\n\n```yml\n...\n\n  - apk add --no-cache py-pip\n  - pip install docker-compose\n\n...\n```\n\n## This image's solution\n\nThis image includes Docker Compose and allows you to run any other arbitrary command.\n\nSo your GitLab CI `.gitlab-ci.yml` file could then look like:\n\n```yml\nimage: tiangolo/docker-with-compose\n\nbefore_script:\n  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY\n\nci:\n  script:\n    - docker-compose build\n    - docker-compose up -d\n    - docker-compose exec -T tests run-tests.sh\n    - docker-compose down -v\n    - docker stack deploy -c docker-compose.prod.yml --with-registry-auth prod-example-com\n```\n\nAnd it would run faster as it doesn't have to install Docker Compose every time.\n\nAnd you could start that initial GitLab Runner following the [GitLab CI runner for CI/CD guide on DockerSwarm.rocks](https://dockerswarm.rocks/gitlab-ci/).\n\nThe same would apply for Travis, Jenkins or whichever CI system you use.\n\n## Release Notes\n\n### Latest Changes\n\n* 🗑️ Deprecate this project, use official Docker instead 🎉. PR [#47](https://github.com/tiangolo/docker-with-compose/pull/47) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Bump actions/checkout from 3.1.0 to 3.3.0. PR [#44](https://github.com/tiangolo/docker-with-compose/pull/44) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Update Latest Changes token. PR [#46](https://github.com/tiangolo/docker-with-compose/pull/46) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add GitHub Action for Docker Hub description. PR [#41](https://github.com/tiangolo/docker-with-compose/pull/41) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Upgrade CI OS. PR [#40](https://github.com/tiangolo/docker-with-compose/pull/40) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Add funding config. PR [#39](https://github.com/tiangolo/docker-with-compose/pull/39) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add automatic scheduled CI every monday. PR [#38](https://github.com/tiangolo/docker-with-compose/pull/38) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add automatic scheduled CI every Monday. PR [#37](https://github.com/tiangolo/docker-with-compose/pull/37) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Update README, replace bash with shell, as Bash itself is not installed. PR [#36](https://github.com/tiangolo/docker-with-compose/pull/36) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add alls-green GitHub Action. PR [#35](https://github.com/tiangolo/docker-with-compose/pull/35) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Do not run double CI for PRs, run on push only on master. PR [#34](https://github.com/tiangolo/docker-with-compose/pull/34) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Bump tiangolo/issue-manager from 0.3.0 to 0.4.0. PR [#28](https://github.com/tiangolo/docker-with-compose/pull/28) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump actions/checkout from 2 to 3.1.0. PR [#31](https://github.com/tiangolo/docker-with-compose/pull/31) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🐛 Fix deployment. PR [#26](https://github.com/tiangolo/docker-with-compose/pull/26) by [@tiangolo](https://github.com/tiangolo).\n* 🐛 Fix GitHub Actions and latest requirements. PR [#25](https://github.com/tiangolo/docker-with-compose/pull/25) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Move from Travis to GitHub Actions. PR [#23](https://github.com/tiangolo/docker-with-compose/pull/23) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Add external dependencies and Dependabot to get automated upgrade PRs. PR [#27](https://github.com/tiangolo/docker-with-compose/pull/27) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add Latest Changes GitHub Action. PR [#24](https://github.com/tiangolo/docker-with-compose/pull/24) by [@tiangolo](https://github.com/tiangolo).\n* Upgrade Python to use version 3.x. PR [#15](https://github.com/tiangolo/docker-with-compose/pull/15).\n* Add `curl` to the installed and available packages. PR [#14](https://github.com/tiangolo/docker-with-compose/pull/14) by [@stratosgear](https://github.com/stratosgear).\n* Add Travis CI. PR [#4](https://github.com/tiangolo/docker-with-compose/pull/4).\n* Upgrade Docker Compose installation. PR [#3](https://github.com/tiangolo/docker-with-compose/pull/3) by [@boskiv](https://github.com/boskiv).\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiangolo%2Fdocker-with-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiangolo%2Fdocker-with-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiangolo%2Fdocker-with-compose/lists"}