{"id":36784108,"url":"https://github.com/nextmn/docker-setup","last_synced_at":"2026-01-12T13:19:30.083Z","repository":{"id":174246559,"uuid":"651974590","full_name":"nextmn/docker-setup","owner":"nextmn","description":"Docker container configuration","archived":false,"fork":false,"pushed_at":"2026-01-11T20:45:17.000Z","size":59,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-12T00:10:26.727Z","etag":null,"topics":["docker","networking"],"latest_commit_sha":null,"homepage":"","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/nextmn.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-10T17:10:41.000Z","updated_at":"2026-01-11T20:45:19.000Z","dependencies_parsed_at":"2024-05-16T15:58:10.589Z","dependency_job_id":"6ec95fb7-e15e-45df-adf0-77d17ef04985","html_url":"https://github.com/nextmn/docker-setup","commit_stats":null,"previous_names":["louisroyer/docker-setup","nextmn/docker-setup"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nextmn/docker-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextmn%2Fdocker-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextmn%2Fdocker-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextmn%2Fdocker-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextmn%2Fdocker-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextmn","download_url":"https://codeload.github.com/nextmn/docker-setup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextmn%2Fdocker-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","networking"],"created_at":"2026-01-12T13:19:29.203Z","updated_at":"2026-01-12T13:19:30.068Z","avatar_url":"https://github.com/nextmn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker-setup\nDocker-setup is a program that allow configure a container (for networking) via environment variables.\n\n## Usage\nThis program only use environment variables for its configuration:\n- `ONESHOT`: when this environment variable is equal to `true`, the program will *not* sleep until a signal (SIGINT or SIGTERM) is received, and not perform cleaning scripts on exit\n- `NAT4_IFACES` is a list of interfaces where MASQUERADE will be enabled\n- `ROUTES_INIT` is a list of routes modifications that will be performed on init\n- `ROUTES_EXIT` is a list of routes modifications that will be performed on exit\n- `PRE_INIT_HOOK` is a command that is run before the init (nat \u0026 routes init). The command can takes some arguments from `PRE_INIT_HOOK_0`, `PRE_INIT_HOOK_1`, and so on.\n- `POST_INIT_HOOK` is a command that is run after the init (nat \u0026 routes init). The command can takes some arguments from `POST_INIT_HOOK_0`, `POST_INIT_HOOK_1`, and so on.\n- `PRE_EXIT_HOOK` is a command that is run before the exit (nat \u0026 routes cleaning). The command can takes some arguments from `PRE_EXIT_HOOK_0`, `PRE_EXIT_HOOK_1`, and so on.\n- `POST_EXIT_HOOK` is a command that is run after the exit (nat \u0026 routes cleaning). The command can takes some arguments from `POST_EXIT_HOOK_0`, `POST_EXIT_HOOK_1`, and so on.\n\n### Example\nIn Docker Compose:\n```yaml\nvolumes:\n    - \"./config_init.sh:/usr/local/bin/config_init.sh:ro\"\n    - \"./config_exit.sh:/usr/local/bin/config_exit.sh:ro\"\nenvironment:\n    ONESHOT: \"false\"\n    ROUTES_INIT: |-\n        - add 10.0.1.0/24 via 10.0.0.2\n        - add 10.0.2.0/24 via 10.0.0.3\n    ROUTES_EXIT: |-\n        - del 10.0.1.0/24\n        - del 10.0.2.0/24\n    NAT4_IFACES: |-\n        - eth0\n        - eth1\n    PRE_INIT_HOOK: config_init.sh\n    PRE_INIT_HOOK_0: \"Hello\"\n    PRE_INIT_HOOK_1: \"World\"\n    PRE_INIT_HOOK_2: \"!\"\n    PRE_EXIT_HOOK: config_exit.sh\n    PRE_EXIT_HOOK_0: \"Goodbye\"\n```\n\n## Getting started\n### Runtime dependencies\n- iproute2\n- iptables\n\n### Build\nRun `go build`\n\n### Docker\n- The container requires the `NET_ADMIN` capability;\n\nThis can be done in `docker-compose.yaml` by defining the following for the service:\n\n```yaml\ncap_add:\n    - NET_ADMIN\n```\n\n## Author\nLouis Royer and the NextMN Contributors\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextmn%2Fdocker-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextmn%2Fdocker-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextmn%2Fdocker-setup/lists"}