Skip to content

Instantly share code, notes, and snippets.

@sjparkinson
Forked from wheresrhys/1. Overview.md
Last active October 19, 2020 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjparkinson/3a9d7627defd3fbad220d67f2f3760f0 to your computer and use it in GitHub Desktop.
Save sjparkinson/3a9d7627defd3fbad220d67f2f3760f0 to your computer and use it in GitHub Desktop.
Update your .circleci/config.yml files to add Docker Hub authentication.
version: 2.1
+ # Docker Hub authentication managed by the shared `dockerhub-shared` context.
+ docker-auth: &docker-auth
+ auth:
+ username: $DOCKERHUB_USERNAME
+ password: $DOCKERHUB_ACCESS_TOKEN
jobs:
test:
docker:
- image: circleci/whatever
+ <<: *docker-auth
steps:
- checkout
- ...
deploy:
docker:
- image: anyorg/whatever
+ <<: *docker-auth
steps:
- checkout
- ...
workflows:
version: 2
workflow:
jobs:
- test:
+ context: dockerhub-shared
- deploy:
context:
+ - dockerhub-shared
- some-other-context-if-necessary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment