Automatic push to a Docker private registry

I’ve set up a Docker private registry and I need to push images to this one from a script that is triggered on each successfull build (build is done with Drone from a dedicated build container).

When I issue a ‘docker push’, I first need to authentify to be able to push to the registry.

  • Problems getting docker containers to see (ping) each other by name
  • Issues with artifactory Docker
  • is it possible to ssh into docker container which is not running ( or exited )?
  • Cross-region load balancing + routing on Google Container Engine
  • Docker how to map subdirectory to port
  • Unable to connect to an ibmnode:latest-based container with putty over ssh
  • Is there any setup I could use to keep the credential somewhere and use it within the script ?

  • Understanding a simple dockerfile of postgresql
  • What is the available information about the files and folder inside the docker container?
  • docker-machine behind corporate proxy
  • How to retrain image on Windows
  • when protractor running in docker and chrome browser is in headless mode then getting “element not visible”
  • How to profile nodejs app for memory leaks inside docker container?
  • 2 Solutions collect form web for “Automatic push to a Docker private registry”

    The way I envisioned it was to just run the command in my scripts to authenticate to docker before you push the image:

    docker login –u <your_username> –p <your_password> <your_docker_registry_fqdn>

    I think it is easier to maintain the script should you have a change in the username or password or have multiple users, no need to download another credentials file which you will have to manually generate with the new password or username.

    I’ve found that .dockercfg was used to keep the credential and the address of the registry.
    Setting this .dockercfg in the $HOME dir fixed the thing.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.