Sign inSign up

nerjs/gitvol

By nerjs

•Updated about 1 year ago

Docker volume plugin that automatically clones a specified Git repository into the volume.

Plugin
Integration & delivery
Developer tools
Databases & storage
1

5.1K

nerjs/gitvol repository overview

⁠Git-backed Volume Driver for Docker.

Automatically clones a Git repository into the volume on mount and removes it on unmount.

⁠Installation
docker plugin install nerjs/gitvol
⁠Usage

Create a volume by specifying a repository URL and (optionally) a tag or branch:

docker volume create -d nerjs/gitvol \
  -o url=https://github.com/username/repository.git \
  -o tag=v1.0.0 \
  my-repo

Run a container with the volume:

docker run --rm -it -v my-repo:/data alpine ls -la /data

Remove the volume:

docker volume rm my-repo

⁠docker-compose / Swarm example
version: "3.8"

services:
  app:
    image: alpine
    command: ["ls", "-la", "/data"]
    volumes:
      - my-repo:/data

volumes:
  my-repo:
    driver: nerjs/gitvol
    driver_opts:
      url: https://github.com/nerjs/gitvol.git
      # Choose ONE of the two lines below (or omit both). Tags are recommended.
      # tag: v1.0.0
      # branch: main

⁠Options

  • url (required) — Git-compatible repository URL. See Git URLs⁠ (now supported only http).

  • tag (optional) — checkout a specific tag (recommended).

  • branch (optional) — checkout a branch. Not recommended since branch contents may change between mounts.

tag and branch are mutually exclusive.


⁠Private repositories

Currently supported via embedding credentials into the URL, e.g.:

docker volume create -d nerjs/gitvol \
  -o url=https://<github_pat_token>@github.com/nerjs/gitvol.git \
  my-private-repo

For source code, issues, and updates see GitHub repository⁠.

Tag summary

Content type

Plugin

Digest

sha256:64fcb7989…

Size

10.8 MB

Last updated

about 1 year ago

docker plugin install nerjs/gitvol