{"id":15779678,"url":"https://github.com/rgl/ubuntu-docker-compose-example","last_synced_at":"2026-05-09T03:31:08.940Z","repository":{"id":139753597,"uuid":"286123294","full_name":"rgl/ubuntu-docker-compose-example","owner":"rgl","description":"example on how to start a docker compose environment in a (remote) docker host","archived":false,"fork":false,"pushed_at":"2025-10-04T18:51:29.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T20:30:07.051Z","etag":null,"topics":["docker","docker-compose","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-08T21:40:36.000Z","updated_at":"2025-10-04T18:50:56.000Z","dependencies_parsed_at":"2025-09-12T02:31:36.346Z","dependency_job_id":"9c30a6d9-c219-4378-8641-1dbed639719b","html_url":"https://github.com/rgl/ubuntu-docker-compose-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rgl/ubuntu-docker-compose-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-docker-compose-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-docker-compose-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-docker-compose-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-docker-compose-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/ubuntu-docker-compose-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-docker-compose-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002409,"owners_count":26083373,"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-09T02:00:07.460Z","response_time":59,"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":["docker","docker-compose","ubuntu"],"created_at":"2024-10-04T18:20:57.860Z","updated_at":"2025-10-10T01:05:26.960Z","avatar_url":"https://github.com/rgl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\n[![Build](https://github.com/rgl/ubuntu-docker-compose-example/actions/workflows/build.yml/badge.svg)](https://github.com/rgl/ubuntu-docker-compose-example/actions/workflows/build.yml)\n\nThis is an example on how to start a docker-compose environment in a (remote) docker host.\n\n**NB** This is similar to [rgl/windows-docker-compose-example](https://github.com/rgl/windows-docker-compose-example).\n\n# Usage\n\nExecute the following commands:\n\n```bash\n# if required, set the DOCKER_HOST environment variable.\n# this make the docker client use this dockerd.\n# NB you must start dockerd with -H tcp://0.0.0.0:2375\n#export DOCKER_HOST=tcp://10.1.0.2:2375\n\n# create the environment defined in docker-compose.yml\n# and leave it running in the background.\ndocker compose up --build -d\n\n# show running containers.\ndocker compose ps\n\n# execute command inside the containers.\ndocker compose exec -T hello ls -laF /\ndocker compose exec -T etcd etcd --version\ndocker compose exec -T etcd etcdctl version\ndocker compose exec -T etcd etcdctl endpoint health\ndocker compose exec -T etcd etcdctl put foo bar\ndocker compose exec -T etcd etcdctl get foo\n\n# get the allocated hello port and create an endpoint url based in\n# the DOCKER_HOST environment variable host.\nhello_endpoint=\"$(\npython3 \u003c\u003c'EOF'\nimport os\nimport urllib.parse\nimport subprocess\n\np = subprocess.Popen(\n    ['docker', 'compose', 'port', 'hello', '8888'],\n    text=True,\n    stdout=subprocess.PIPE,\n    stderr=subprocess.STDOUT)\nstdout, stderr = p.communicate()\nif 'DOCKER_HOST' in os.environ:\n    docker_host_ip_address = urllib.parse.urlparse(os.environ['DOCKER_HOST']).netloc.split(':')[0]\n    hello_port = stdout.strip().split(':')[-1]\n    hello_endpoint = f'http://{docker_host_ip_address}:{hello_port}'\nelse:\n    hello_endpoint = f'http://{stdout.strip()}'\nprint(hello_endpoint)\nEOF\n)\"\n\n# invoke the hello endpoint.\nwget -qO- $hello_endpoint\n\n# show logs.\ndocker compose logs\n\n# destroy the environment.\ndocker compose down --volumes\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fubuntu-docker-compose-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fubuntu-docker-compose-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fubuntu-docker-compose-example/lists"}