…by using Docker in Docker.
I found that I couldn’t configure Jenkins to use a proxy server for Docker. However, I could spin up a Docker container within the pipeline that could. This is how to do that…
Have a docker in docker image with the AWS cli installed that can be puled by Jenkins. In the example below I’ve used “docker_tooling:latest” to represent this.
This Jenkinsfile consists of a stage that will spin up a “dind” container with a configured proxy, which can then be used in later steps by running docker exec
commands against it.
This isn’t a fantastic solution, but helps if you’re in a pickle.
I hope you found this useful!
Cheers 🤙