Terraform provider for gcrane.
Allows copying images between Docker registries and also fetching some details (like images, tags, etc).
Does not require gcrane or Docker installed.
This is a community maintained provider and not an official Google or Hashicorp product.
# The provider creates a temporary Docker config
provider "gcrane" {
docker_config = <<-EOT
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "12345678...abc..."
},
}
"credHelpers": {
"europe-west4-docker.pkg.dev": "gcloud"
}
}
EOT
}
resource "gcrane_copy" "copied_image" {
recursive = false
source = "google/cloud-sdk:slim"
destination = "europe-west4-docker.pkg.dev/my-project/my-repo/my-image:latest"
}
data "gcrane_list" "images" {
repository = "google/cloud-sdk"
}- Clone the repository
- Enter the repository directory
- Build the provider using the Go
installcommand:
go installThis provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency to your Terraform provider:
go get github.com/author/dependency
go mod tidyThen commit the changes to go.mod and go.sum.