Public | Automated Build

Last pushed: a year ago
Short Description
Clone or pull mercurial bitbucket repository in local volume and expose it for later use.
Full Description

hgrepos-cloner

Features:

  • Clone or pull mercurial bitbucket repository in a local volume and expose it for later use.
  • Reference it in other containers with --volume-from directive.
  • Update it every time you need.
  • Clone a particular branch, tag, or changeset.
  • Public or private repository allowed.

Note:

For private repositories id_rsa keys are needed. For a simple ssh howto see https://bitbucket.org/enricomariam42/docker-sshkey.

How to use this image.

The default environment in the image is:

BITBUCKET_USER=enricomariam42
BITBUCKET_REPOS=test
HOME=/root
REPOS_DIR=/root/repos

Super simple use:

Create a test container named my-test-repos-container, with a default folder /root/repos containing a default user enricomariam42 repository test.

Then reference it on an other container to explore or use it in some other cool way.

    docker run --name my-test-repos-container enricomariam42/hgrepos-cloner

How to link previously created data container:

Run another container linked to previously created data container with the following command:

    docker run --name some-app --volumes-from my-test-repos-container application-that-uses-container

Eg.: How to access repository folder:

    docker run -it --name testrepo --volumes-from my-test-repos-container --rm gliderlabs/alpine sh

Tipical use:

Create a container with a cloned repository: use environment variable to specify online user & repos...

    docker run --name myrepos-container -e BITBUCKET_USER=enricomariam42 -e BITBUCKET_REPOS=test enricomariam42/hgrepos-cloner

(or create it empty)

    docker create --name myrepos-container -e BITBUCKET_USER=enricomariam42 -e BITBUCKET_REPOS=test enricomariam42/hgrepos-cloner

...and then update it (every time you need)!

    docker start -i myrepos-container

Clone a particular branch, tag, or changeset:

Follow repository name environment variable with hash and branch, tag, or changeset name. Eg.: BITBUCKET_REPOS=myrepo#branch

    docker run --name myrepos-container -e BITBUCKET_USER=enricomariam42 -e BITBUCKET_REPOS=test#default enricomariam42/hgrepos-cloner

Clone to a specified folder:

Use REPOS_DIR environment variable:

    docker run --name myrepos-container -e REPOS_DIR=/clone/to/folder -e BITBUCKET_USER=enricomariam42 -e BITBUCKET_REPOS=test#default enricomariam42/hgrepos-cloner

Private repositories:

For private repositories link a container with the ssh key.
To simpy generate it see https://bitbucket.org/enricomariam42/docker-sshkey.
You may need paste the public key in your repository deployment keys, see https://bitbucket.org/*BITBUCKET_USER*/*BITBUCKET_REPOS*/admin/deploy-keys/

    docker run --volumes-from sshkey-container --name myrepos-container -e BITBUCKET_USER=enricomariam42 -e BITBUCKET_REPOS=test enricomariam42/hgrepos-cloner

Full featured use:

Clone private user enricomariam42 branch default repository test to specified folder /clone/to/folder

    docker run --volumes-from sshkey-container --name myrepos-container -e REPOS_DIR=/clone/to/folder -e BITBUCKET_USER=enricomariam42 -e BITBUCKET_REPOS=test#default enricomariam42/hgrepos-cloner

TODO:

  • support for corporate proxy
Docker Pull Command
Owner
enricomariam42

Comments (0)