A base image for running terraform against Google cloud resources.
Build the image and then run the container:
docker image build -t cloud-builder .
docker run -it cloud-builder:latestI'd recommend using hadolint to lint your docker files so you follow best practice and avoid syntax errors or security issues.
brew install hadolintThere's a nice plugin as well for VSCode, or you can run it from the command line using:
hadolint DockerfileOnce built, you can manually deploy your image to test it out.
Firstly, configure docker to use gcloud as a credential helper:
gcloud auth configure-dockerThen tag your docker image with the container registry name, for example:
docker tag cloud-builder eu.gcr.io/"$PROJECT"/cloud-builderPush the tagged image to the container registry:
docker push eu.gcr.io/"$PROJECT"/cloud-builder