Using this container, you can save and manage the Docker Hub API token and create a repository from the command line.
Please contact me anytime if you have a problem or request! My information is posted at the bottom of this document.
You do not need to install !
authenticate by running with DOCKER_HUB_USERNAME and DOCKER_HUB_PASSWORD ENVIRONMENT VARIABLES:
# Authentication settings to use API TOKEN
$ docker run -it \
-e DOCKER_HUB_USERNAME \
-e DOCKER_HUB_PASSWORD \
--name docker_hub_cli-config genzouw/docker_hub_cli login
# IF environment variables is undefined, you use a follow command.
$ docker run -it \
-e DOCKER_HUB_USERNAME=your_name \
-e DOCKER_HUB_PASSWORD=your_password \
--name docker_hub_cli-config genzouw/docker_hub_cli login
Once you authenticate successfully, credentials are preserved in the volume of the docker_hub_cli-config container.
To create Docker Hub repository using these credentials, run the container with --volumes-from:
$ docker run --rm --volumes-from docker_hub_cli-config genzouw/docker_hub_api create_repository myrepo
https://hub.docker.com/repository/docker/genzouw/myrepo
I recommend that you set the following alias in ~/.*rc
.
$ alias docker_hub='docker run --rm --volumes-from docker_hub_cli-config genzouw/docker_hub_api'
This software is released under the MIT License, see LICENSE.
Got a question ?
File a Github issue, send an email to genzouw@gmail.com or tweet to @genzouw on Twitter.
- Twitter : @genzouw ( https://twitter.com/genzouw )
- Facebook : genzouw ( https://www.facebook.com/genzouw )
- LinkedIn : genzouw ( https://www.linkedin.com/in/genzouw/ )
- Gmail : genzouw@gmail.com