{"id":13548371,"url":"https://github.com/costela/docker-volume-hetzner","last_synced_at":"2025-04-09T00:57:48.494Z","repository":{"id":34841688,"uuid":"154749904","full_name":"costela/docker-volume-hetzner","owner":"costela","description":"Docker Volume Plugin for accessing Hetzner Cloud Volumes","archived":false,"fork":false,"pushed_at":"2024-04-23T06:42:39.000Z","size":115,"stargazers_count":114,"open_issues_count":8,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-02T21:37:31.864Z","etag":null,"topics":["cluster","docker","docker-swarm","docker-volume-plugin","hetzner","hetzner-cloud","hetzner-cloud-volumes"],"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/costela.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":"2018-10-25T23:26:59.000Z","updated_at":"2025-03-14T18:08:38.000Z","dependencies_parsed_at":"2023-11-06T12:28:46.464Z","dependency_job_id":"2fb71b8c-e61e-4d01-89b1-d6abfa909d63","html_url":"https://github.com/costela/docker-volume-hetzner","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costela%2Fdocker-volume-hetzner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costela%2Fdocker-volume-hetzner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costela%2Fdocker-volume-hetzner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/costela%2Fdocker-volume-hetzner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/costela","download_url":"https://codeload.github.com/costela/docker-volume-hetzner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953108,"owners_count":21023947,"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":["cluster","docker","docker-swarm","docker-volume-plugin","hetzner","hetzner-cloud","hetzner-cloud-volumes"],"created_at":"2024-08-01T12:01:09.468Z","updated_at":"2025-04-09T00:57:48.457Z","avatar_url":"https://github.com/costela.png","language":"Go","funding_links":[],"categories":["Go","Community Tools","Integrations"],"sub_categories":["Volumes and Storage","Rust"],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/costela/docker-volume-hetzner)](https://goreportcard.com/report/github.com/costela/docker-volume-hetzner)\n![tests](https://github.com/costela/docker-volume-hetzner/actions/workflows/main.yaml/badge.svg)\n\n# Docker Volume Plugin for Hetzner Cloud\n\nThis plugin manages docker volumes using Hetzner Cloud's volumes.\n\n**This plugin is still in ALPHA; use at your own risk**\n\n## Installation\n\nTo install the plugin, run the following command:\n```shell\n$ docker plugin install --alias hetzner ghcr.io/costela/docker-volume-hetzner:...-amd64\n```\n\nWhen using Docker Swarm, this should be done on all nodes in the cluster.\n\n**Important**: the plugin expects the Docker node's `hostname` to match with the name of the server created on Hetzner Cloud. This should usually be the case, unless explicitly changed.\n\n#### Plugin privileges\n\nDuring installation, you will be prompted to accept the plugins's privilege requirements. The following are required:\n\n- **network**: used for communicating with the Hetzner Cloud API\n- **mount[\\/dev\\/]**: needed for accessing the Hetzner Cloud Volumes (made available to the host as a SCSI device)\n- **allow-all-devices**: actually enable access to the volume devices mentioned above (since the devices cannot be known a priori)\n- **capabilities[CAP\\_SYS\\_ADMIN,CAP\\_CHOWN]**: needed for running `mount` and `chown`\n\n## Usage\n\nFirst, create an API key from the Hetzner Cloud console and save it temporarily.\n\nInstall the plugin as described above. Then, set the API key in the plugin options, where `\u003capikey\u003e` is the key you just created:\n\n```shell\n$ docker plugin disable hetzner\n$ docker plugin set hetzner apikey=\u003capikey\u003e\n$ docker plugin enable hetzner\n```\n\nAgain, when using Docker Swarm, this should be done on all nodes in the cluster.\n\nThe plugin is then ready to be used, e.g. in a `docker-compose` file, by setting the `driver` option on the docker `volume` definition (assuming the alias `hetzner` passed during installation above).\n\nFor example, when using the following `docker-compose` volume definition in a project called `foo`:\n\n```yaml\nvolumes:\n  somevolume:\n    driver: hetzner\n```\n\nThis will initialize a Hetzner volume named `docker-foo_somevolume` (see the `prefix` configuration below).\n\nIf the volume `docker-foo_somevolume` does not exist in the Hetzner Cloud project, the plugin will do the following:\n\n1. Create the Hetzner Cloud (HC) volume\n2. Attach the created HC volume to the node requesting the creation (when using docker swarm, this will be the manager node being used)\n3. Format the HC volume (using `fstype` option; see below)\n4. `chown` the volume to the appropriate `uid`/`gid` if specified.\n\nThe plugin will then mount the volume on the node running its parent service, if any.\n\n## Configuration\n\nThe following options can be passed to the plugin via `docker plugin set` (all names **case-sensitive**):\n\n- **`apikey`** (**required**): authentication token to use when accessing the Hetzner Cloud API\n- **`size`** (optional): size of the volume in GB (default: `10`)\n- **`fstype`** (optional): filesystem type to be created on new volumes. Currently supported values are `ext{2,3,4}` and `xfs` (default: `ext4`)\n- **`prefix`** (optional): prefix to use when naming created volumes; the final name on the HC side will be of the form `prefix-name`, where `name` is the volume name assigned by `docker` (default: `docker`)\n- **`loglevel`** (optional): the amount of information that will be output by the plugin. Accepts any value supported by [logrus](https://github.com/sirupsen/logrus) (i.e.: `fatal`, `error`, `warn`, `info` and `debug`; default: `warn`)\n- **`use_protection`** (optional): whether to enable/disable deletion protection on creation/deletion. Disable this if you want to manage deletion protection yourself. (default: `true`)\n- **`uid`** (optional): which user id to use by default as owners for the filesystem of newly created volumes\n- **`gid`** (optional): which group id to use by default as owners for the filesystem of newly created volumes\n\nAdditionally, `size`, `fstype`, `uid` and `gid` can also be passed as options to the driver via `driver_opts`:\n\n```yaml\nvolumes:\n  somevolume:\n    driver: hetzner\n    driver_opts:\n      size: '42'\n      fstype: xfs\n      uid: '999'\n      gid: '999'\n```\n\n:warning: Passing any option besides `size`, `fstype`, `uid` and `gid` to the volume definition will have no effect beyond a warning in the logs. Use `docker plugin set` instead.\n\n## Limitations\n\n- *Concurrent use*: Hetzner Cloud volumes currently cannot be attached to multiple nodes, so the same limitation\napplies to the docker volumes using them. This also precludes concurrent use by multiple containers on the same node,\nsince there is currently no way to enforce docker swarm services to be managed together (cf. kubernetes pods).\n- *Single location*: since volumes are currently bound to the location they were created in, this plugin will not\nbe able to reattach a volume if you have a swarm cluster across locations and its service migrates over the location\nboundary.\n- *Volume resizing*: docker has no support for updating volume definitions. After a volume is created, its `size`\noption is currently ignored. This may be worked around in a future release.\n- *Docker partitions*: when used in a docker swarm setup, there is a chance a network hiccup between docker nodes\nmight be seen as a node down, in which case the scheduler will start the container on a different node and will\n\"steal\" its volume while in use, potentially causing data loss.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostela%2Fdocker-volume-hetzner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcostela%2Fdocker-volume-hetzner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostela%2Fdocker-volume-hetzner/lists"}