A lot of companies have their own private Docker registry to host their Docker images. Or they have private repositories on Docker Hub.
If you have images referenced in your Dockerfile that are not publicly available from Docker Hub (maybe something like
FROM mycompany/secretproject:latest) you can give WunderPreview the configuration to your private Docker registry so WunderPreview can pull your images when it is building your previews.
This also works if your Docker images are on Docker Hub, but not publicly available and you need to login with your Docker Hub credentials to pull those images.
You can configure your private Docker registry with environment variables in your repositories settings in WunderPreview.
Here is how:
Select one of your GitHub organizations in WunderPreview. In the list of the repository click on the little cog on the right side to enter the settings screen.
Add three environment variables to your repository. The variables must be named:
WDPR_PRIVATE_DOCKER_REGISTRY_USERNAMEthe username that is used in the "docker login" command.
WDPR_PRIVATE_DOCKER_REGISTRY_PASSWORDthe password that is used in the "docker login" command.
WDPR_PRIVATE_DOCKER_REGISTRY_SERVERthe server to which the "docker login" command should connect. If you want to use the default Registry from Docker Hub, you need to specify
In the end it should look something like this:
You need to supply all three environment variables in order for WunderPreview to log in to your private Docker registry.
If you click the "Update environment variables" button, WunderPreview will start logging into your private Docker registry when building your previews.
Because Amazon takes security very serious there a few things you need to do different if you are using ECR as your container registry.
The basic setup for ECR is the same as with username/password based registries (see above), but for ECR you need to use different environment variables in your configuration of the repsitory in WunderPreview:
WDPR_PRIVATE_DOCKER_REGISTRY_AWS_ACCESS_KEY_IDThe access key of the Amazon IAM user to use. (We strongly recommend to create a separate IAM user that only has access to your ECR registry)
WDPR_PRIVATE_DOCKER_REGISTRY_AWS_SECRET_ACCESS_KEYThe secret access key of the Amazon IAM user to use. (We strongly recommend to create a separate IAM user that only has access to your ECR registry)
WDPR_PRIVATE_DOCKER_REGISTRY_AWS_DEFAULT_REGIONThe region your ECR registry is running in.
WDPR_PRIVATE_DOCKER_REGISTRY_SERVERthe URI of your repository in ECR. Not including the image tag. (eg:
If you set all of these variables WunderPreview log into your registry on ECR.
Do you have any questions or remarks? Just send us an email to firstname.lastname@example.org. We are happy to hear from you!