{"id":21700374,"url":"https://github.com/articulate/docker-bootstrap","last_synced_at":"2025-04-12T13:34:16.623Z","repository":{"id":8385665,"uuid":"58210370","full_name":"articulate/docker-bootstrap","owner":"articulate","description":"Load values from Consul and Vault as environment variables","archived":false,"fork":false,"pushed_at":"2025-04-01T01:08:07.000Z","size":519,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":56,"default_branch":"main","last_synced_at":"2025-04-08T22:02:14.454Z","etag":null,"topics":["consul","docker","team-devex-sre","vault"],"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/articulate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-06T13:48:06.000Z","updated_at":"2025-03-31T20:14:05.000Z","dependencies_parsed_at":"2024-03-28T19:32:13.765Z","dependency_job_id":"d6cd1d7f-99ba-4ec3-89a4-6d50a12265e8","html_url":"https://github.com/articulate/docker-bootstrap","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/articulate%2Fdocker-bootstrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/articulate%2Fdocker-bootstrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/articulate%2Fdocker-bootstrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/articulate%2Fdocker-bootstrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/articulate","download_url":"https://codeload.github.com/articulate/docker-bootstrap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573496,"owners_count":21126841,"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":["consul","docker","team-devex-sre","vault"],"created_at":"2024-11-25T20:14:08.983Z","updated_at":"2025-04-12T13:34:16.618Z","avatar_url":"https://github.com/articulate.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Consul Template Bootstrap\n\nLoad values from Consul and Vault as environment variables.\n\n## Installing\n\nDownload the [latest release](https://github.com/articulate/docker-bootstrap/releases),\nadd it to your image, and set it as your `ENTRYPOINT`.\n\nIf you are using Buildkit you can use the `TARGETARCH` arg to `ADD` the correct\narchitecture.\n\n```docker\nARG TARGETARCH\nADD --chmod=755 https://github.com/articulate/docker-bootstrap/releases/latest/download/docker-bootstrap_linux_${TARGETARCH} /entrypoint\n\nENTRYPOINT [ \"/entrypoint\" ]\n```\n\n## Usage\n\nTo load values from Consul's KV store, you will need to set `CONSUL_ADDR`. It\nwill load keys from the following paths, using the basename as the variable name:\n\n* `global/env_vars/*`\n* `global/${SERVICE_ENV}/env_vars/*`\n* `services/${SERVICE_NAME}/env_vars/*`\n* `services/${SERVICE_NAME}/${SERVICE_ENV}/env_vars/*`\n\nFor example, `consul kv put services/foo/env_vars/API_SERVICE_URI https://api.priv/v1`\nwill load an environment variable `API_SERVICE_URI=https://api.priv/v1`.\n\nAny environment variables set previous to calling the script, will not change.\nPaths later in the list will overwrite any previous values. For example,\n`global/env_vars/FOO` will be overwritten by `service/my-service/env_vars/FOO`.\n\nTo load values from Vault, you will need to set `VAULT_ADDR` and authenticate with\nVault (see below). Values from vault will use the `value` key as the variable value.\nValues are read from the following paths:\n\n* `secret/global/env_vars/*` (in `stage` or `prod`)\n* `secret/global/${SERVICE_ENV}/env_vars/*`\n* `secret/services/${SERVICE_NAME}/env_vars/*` (in `stage` or `prod`)\n* `secret/services/${SERVICE_NAME}/${SERVICE_ENV}/env_vars/*`\n\nFor example, `vault write secret/services/foo/env_vars/API_KEY value=secretkey` will load\nan environment variable `API_KEY=secretkey`. Values from Vault will overwrite\nConsul values, but follow the same rules otherwise.\n\n\u003cdetails\u003e\n\u003csummary\u003eVault Authentication\u003c/summary\u003e\n\nYou can authenticate with Vault in one of the following ways:\n\n* Set `VAULT_TOKEN`\n* If running on Kubernetes, use the Kubernetes auth method in Vault\n* If running on AWS ECS or Lambda, use the AWS IAM auth method\n  * If Vault role does not match IAM role, set with `VAULT_ROLE`\n\n\u003c/details\u003e\n\n### Environment Variables\n\nIf you want to ensure some environment variables exist before running your command,\nyou can include a JSON file called `service.json` in the working directory. The\nentrypoint will parse this file and check that the configured environment variables\nexist and are not empty.\n\n```json\n{\n  \"dependencies\": {\n    \"env_vars\": {\n      \"required\": [\n        \"FOO\",\n        \"BAR\"\n      ],\n      \"optional\": [\n        \"BAZ\"\n      ]\n    }\n  }\n}\n```\n\nIf any optional environment variables are missing, it will log that, but continue\nto run.\n\nIf any required environment variables are missing, it will log that and then exit\nwith an exit code of 4.\n\n## Development\n\nYou'll need to install the following:\n\n* Go\n* [golangci-lint](https://golangci-lint.run/) (`brew install golangci-lint`)\n* [pre-commit](https://pre-commit.com/) (`brew install pre-commit`)\n* [GoReleaser](https://goreleaser.com/) (_optional_)\n\nSetup the build environment with `make init`. Run tests with `make test` and lint\ncode with `make lint`.\n\nWhen committing, you'll need to follow the [Conventional Commits](https://www.conventionalcommits.org)\nformat. You can install a tool like [git-cz](https://github.com/commitizen/cz-cli#conventional-commit-messages-as-a-global-utility)\nor [commitizen](https://github.com/commitizen-tools/commitizen#installation).\n\n## Creating a Release\n\nTo create a release, create a tag that follows [semver](https://semver.org/). A\nGitHub Action workflow will take care of creating the release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farticulate%2Fdocker-bootstrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farticulate%2Fdocker-bootstrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farticulate%2Fdocker-bootstrap/lists"}