🐳 Login to Docker registries
Clone or download
toolmantim Merge pull request #33 from buildkite-plugins/renovate/docker-buildki…
…te-plugin-tester-latest

Update buildkite/plugin-tester:latest Docker digest to ee0d1ad
Latest commit aea25f7 Dec 25, 2018

README.md

Docker Login Buildkite Plugin

A Buildkite plugin to login to docker registries.

Securing your password

To avoid leaking your docker password to buildkite.com or anyone with access to build logs, you need to avoid including it in pipeline.yml. This means it needs to be set specifically with an environment variable in an Agent hook, for instance the environment hook.

The examples below show how to provide passwords for single and multiple registries.

Example: Login to docker hub (or a single server)

# environment or pre-command hook
export DOCKER_LOGIN_PASSWORD=mysecretpassword
steps:
  - command: ./run_build.sh
    plugins:
      - docker-login#v2.0.1:
          username: myuser
          password-env: DOCKER_LOGIN_PASSWORD

Example: Log in to multiple registries

# environment or pre-command hook
export DOCKER_LOGIN_MY_PRIVATE_REGISTRY=mysecretpassword1
export DOCKER_LOGIN_ANOTHER_REGISTRY=mysecretpassword2
steps:
  - command: ./run_build.sh
    plugins:
      - docker-login#v2.0.1:
          - server: my.private.registry
            username: myuser
            password-env: DOCKER_LOGIN_MY_PRIVATE_REGISTRY
          - server: another.private.registry
            username: myuser
            password-env: DOCKER_LOGIN_ANOTHER_REGISTRY

Options

username

The username to send to the docker registry.

server (optional)

The server to log in to, if blank or ommitted logs into Docker Hub.

password-env

The environment variable that the password is stored in

Defaults to DOCKER_LOGIN_PASSWORD.

License

MIT (see LICENSE)