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.

  • Error when run clickhouse docker image on mac os
  • CentOS 6 Docker 1.7 with error “panic: runtime error: invalid memory address or nil pointer dereference”
  • Somtimes docker container dns fail
  • Docker UCP Content Trust not work, notary
  • How to user docker exec with zsh
  • user unbound variable on docker run
  • Is there any setup I could use to keep the credential somewhere and use it within the script ?

  • Concourse CI: leverage docker image cache
  • Connecting to Dockerized MySQL from remote client
  • How can I start php-fpm in a Docker container by default?
  • Run docker-compose build in .gitlab-ci.yml
  • Jenkins using docker: How to run tests?
  • Nightwatch inside Docker only works with Phantom
  • 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.