Integrate DockerHub in Codefresh pipelines
To configure Docker Hub so that your pipelines can push images to it, first select Docker Hub from the new registry drop down and then provide the following:
- Registry Name - a unique name for this configuration.
- Username - Docker Hub username.
- Password - Docker Hub personal account token or Dockerhub account password (not recommended)
Note that Docker.io only allows you to push images that are tagged with your username. If you have a choice, create a Dockerhub account with the same username that you have in Codefresh. If not, you need to change the Docker image created to match your username in every push step.
If you have enabled two-factor-authentication in Dockerhub, then in the password field above you must put a Docker personal access token (instead of your Dockerhub master password). Otherwise Codefresh will not be able to push your image.
If you don’t have 2FA enabled in Dockerhub, then you can also use your Dockerhub account password. But in all cases we suggest you create a personal access token for Codefresh (personal access tokens are more secure as you can revoke them on demand and see when they were last used).
Adding more Dockerhub integrations
You can add additional Dockerhub accounts using the same process.
You can specify which registry will be used as primary/default for the docker.io domain.
Use the appropriate
registry name value in your pipelines in order to decide which Dockerhub account will be used.
Here is a pipeline that is pushing to two different Dockerhub accounts:
This is the respective pipeline definition:
The two Dockerhub accounts are
kostiscodefresh, and Codefresh is automatically using the correct integration by looking at the
image_name property of the push step.