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.

  • Running magellan on pyspark-notebook docker container
  • Lumen does not read env from system during request
  • elastic beanstalk application can't find private docker image
  • How to setup a docker swarm cluster with AWS ubuntu machine [closed]
  • Unable to pull my private image from docker hub
  • how do I build a docker image without existing from a docker file
  • Is there any setup I could use to keep the credential somewhere and use it within the script ?

  • Setting a static IP to docker container using LXC driver
  • How to manage many hosts with shipyard
  • Docker: Container command '/bin/sh' not found
  • Run image in docker
  • How to start a mongodb shell in docker container?
  • bind docker containers services start on the specific port
  • 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.