Managing container images using Ansible
As we learned from Figure 10.6, your integration stage will begin when the developers push the code or merge the branches in a Git repository. Call the container build commands directly from your CI/CD tools, such as Jenkins or GitHub Actions. However, commands and pipeline tasks are unpredictable, so you will not have much control over the output and results. This is where you can utilize Ansible playbooks as you have more flexibility and control over the build processes and outputs.
In the next few sections, you will learn how to create Docker container registry access, build container images using Ansible, and save the container images in the container registry.
Configuring Docker Registry access
Before pushing the latest images to the container registries, you need to log into the registry with your credentials. Access Docker Registry using a username and password, but it is a best practice to use Access Tokens instead of passwords...