{"id":16012521,"url":"https://github.com/bircher/docker-relay","last_synced_at":"2025-03-18T02:32:41.076Z","repository":{"id":81468716,"uuid":"200368163","full_name":"bircher/docker-relay","owner":"bircher","description":"Run everything in containers, relay code execution to the containers","archived":false,"fork":false,"pushed_at":"2023-10-20T12:11:17.000Z","size":35,"stargazers_count":10,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T06:30:43.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bircher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2019-08-03T11:34:08.000Z","updated_at":"2025-01-13T12:15:03.000Z","dependencies_parsed_at":"2024-06-21T15:39:51.749Z","dependency_job_id":"76316fda-3697-450e-8f21-737320651f19","html_url":"https://github.com/bircher/docker-relay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bircher%2Fdocker-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bircher%2Fdocker-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bircher%2Fdocker-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bircher%2Fdocker-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bircher","download_url":"https://codeload.github.com/bircher/docker-relay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243896317,"owners_count":20365355,"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":[],"created_at":"2024-10-08T14:03:50.433Z","updated_at":"2025-03-18T02:32:40.726Z","avatar_url":"https://github.com/bircher.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker-relay\nThis project solves the problem you have when you containerise everything\nincluding the interpreter for your favourite scripting language, yet you still\nwant to run the scripts from your host. For example if you have a git hook that\nexecutes a php script but php only runs in your docker composed containers.\nAlso, as a convenience to follow steps in a readme that are not written with\na containerised environment in mind.\n\n## Setup\nClone the repository and run \n`docker run -it --rm -v \"$PWD\":/usr/src/dr -w /usr/src/dr golang:1.20 go build`\n(Or if you have go on your system just run `go build`)\nThen symlink docker-relay into your path with the name of the program you want\nto relay. For example for php do:\n`sudo ln -s ${PWD}/docker-relay /usr/local/bin/php`.\n\nYou need docker with a relatively recent version so that it contains compose.\nDocker-relay uses `docker compose ps` to find the container. \n\n## Configuration\ndocker-relay looks for a `.docker-relay.(yml|toml|json)` file in the current\ndirectory and your home directory. For the sake of this documentation we use\nyaml as an example, but you are free to choose your preferred format.\n\nThe name of the program/symlink is the top level key.\nFor example \n```\nphp:\n  container: php # The name of the container in your docker-compose, defaults to the name of the program\n  path: \".\" # The path to replace the current directory with, defaults to empty in which case it is not used.\n  cmd: php # The command to run in the container (can be a list)\n```\n\nSometimes a command needs to run inside a docker compose container, and\nsometimes it needs to be run in its own container.\nFor example: `composer create-project`\nIn case the container can not be found we can run a backup image with\nthe following configuration:\n\n```\ncomposer:\n  container: php # Usually run in the php container\n  cmd: composer # run the composer command in it\n  user: 1000 # Use user 1000\n  run:\n    image: 'composer:latest' # use the backup image\n    volume: # Mount volumes for composer to interact with the file system\n      - '${PWD}:/app'\n      - '${HOME}/.cache/composer:/composer'\n\n```\n\nIf the container config is set to `!` then it will not look it up and go\nstraight to running the image.\nThe configuration under the `run` key inherits everything from the top key\nand can override it if needed as well as add new options.\nEnvironment variables are loaded from the `.env` file in the current directory\nand can be used if they match the regular expression `\\$\\{[A-Z_]\\}`\n\n## Contributing\nWe still need unit tests for the go code and documentation of all the options.\nPull requests are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbircher%2Fdocker-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbircher%2Fdocker-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbircher%2Fdocker-relay/lists"}