We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terraform v1.9.8 kreuzwerker/docker v3.0.2
terraform v1.9.8
kreuzwerker/docker v3.0.2
docker_image
terraform { backend "s3" {} required_version = ">= 1.0.0" required_providers { aws = { source = "hashicorp/aws" version = ">= 5.76" } docker = { source = "kreuzwerker/docker" version = ">= 3.0.2" } } } variable "name" { type = string description = "name for the resources" } variable "environment" { type = string description = "environment for the resources" } variable "image_tag" { type = string description = "container image tag" } variable "project" { type = string description = "project name in monorepo" } locals { ns = "${var.name}-${var.environment}" } data "aws_region" "current" {} data "aws_caller_identity" "current" {} data "aws_ecr_authorization_token" "token" {} provider "aws" {} provider "docker" { registry_auth { address = format("%v.dkr.ecr.%v.amazonaws.com", data.aws_caller_identity.current.account_id, data.aws_region.current.name) username = data.aws_ecr_authorization_token.token.user_name password = data.aws_ecr_authorization_token.token.password } } module "docker_image" { source = "terraform-aws-modules/lambda/aws//modules/docker-build" docker_file_path = "Dockerfile.frontend" create_ecr_repo = true ecr_repo = trim(replace(local.ns, "--" , "-"), "-") # replace double dash with simple dash and trim ending dash image_tag = var.image_tag source_path = "../../" build_args = { NODE_VERSION = "20" PROJECT = var.project PORT = "8080" } } module "lambda_function_from_container_image" { source = "terraform-aws-modules/lambda/aws" function_name = local.ns description = "Ephemeral preview environment for: ${local.ns}" create_package = false package_type = "Image" image_uri = module.docker_image.image_uri architectures = ["x86_64"] create_lambda_function_url = true timeout = 30 memory_size = 1024 } output "endpoint_url" { value = module.lambda_function_from_container_image.lambda_function_url }
https://gist.github.com/LucasDemea/6c7cb9c86285450283069ef08b50f18c
Docker image should build
Build fails on step RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile.
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
The error is : Error: process "/bin/sh -c pnpm install --frozen-lockfile" did not complete successfully: exit code: 1
Error: process "/bin/sh -c pnpm install --frozen-lockfile" did not complete successfully: exit code: 1
It seems the generated command is missing quotes, and should be instead: /bin/sh -c "pnpm install --frozen-lockfile".
/bin/sh -c "pnpm install --frozen-lockfile"
terraform apply
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Community Note
Terraform (and docker Provider) Version
terraform v1.9.8
kreuzwerker/docker v3.0.2
Affected Resource(s)
docker_image
Terraform Configuration Files
Debug Output
https://gist.github.com/LucasDemea/6c7cb9c86285450283069ef08b50f18c
Expected Behaviour
Docker image should build
Actual Behaviour
Build fails on step
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
.The error is :
Error: process "/bin/sh -c pnpm install --frozen-lockfile" did not complete successfully: exit code: 1
It seems the generated command is missing quotes, and should be instead:
/bin/sh -c "pnpm install --frozen-lockfile"
.Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: