Skip to content

Bug: "Unable to find Local Image" #7824

@caleb-lyceum

Description

@caleb-lyceum

Description:

Hello, I am trying to run my docker image with SAM CLI however it is not finding my local docker image that I reference in my template.

Steps to reproduce:

Create a SAM template using a docker image and docker image URI that references a local image, sam build, sam local invoke and it is not finding my local docker image.

Observed result:

2025-01-08 10:33:33,299 | No config file found in this directory.
2025-01-08 10:33:33,301 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/calebanderson/Documents/source/lyceum/ellie-api/functions/split_pdfs/samconfig.toml'
2025-01-08 10:33:33,302 | Config file location: /Users/calebanderson/Documents/source/lyceum/ellie-api/functions/split_pdfs/samconfig.toml
2025-01-08 10:33:33,302 | Config file '/Users/calebanderson/Documents/source/lyceum/ellie-api/functions/split_pdfs/samconfig.toml' does not exist
2025-01-08 10:33:33,304 | Using SAM Template at /Users/calebanderson/Documents/source/lyceum/ellie-api/functions/split_pdfs/.aws-sam/build/template.yaml
2025-01-08 10:33:33,317 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/calebanderson/Documents/source/lyceum/ellie-api/functions/split_pdfs/samconfig.toml'
2025-01-08 10:33:33,318 | Using config file: samconfig.toml, config environment: default
2025-01-08 10:33:33,318 | Expand command line arguments to:
2025-01-08 10:33:33,318 | --template_file=/Users/calebanderson/Documents/source/lyceum/ellie-api/functions/split_pdfs/.aws-sam/build/template.yaml --no_event
--layer_cache_basedir=/Users/calebanderson/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1
2025-01-08 10:33:33,319 | local invoke command is called
2025-01-08 10:33:33,373 | No current session found, using default AWS::AccountId
2025-01-08 10:33:33,374 | No Parameters detected in the template
2025-01-08 10:33:33,385 | There is no customer defined id or cdk path defined for resource LambdaFunction, so we will use the resource logical id as the resource id
2025-01-08 10:33:33,386 | 0 stacks found in the template
2025-01-08 10:33:33,386 | No Parameters detected in the template
2025-01-08 10:33:33,394 | There is no customer defined id or cdk path defined for resource LambdaFunction, so we will use the resource logical id as the resource id
2025-01-08 10:33:33,394 | 1 resources found in the stack
2025-01-08 10:33:33,395 | Found Serverless function with name='LambdaFunction' and ImageUri='pdf-splitter:latest'
2025-01-08 10:33:33,395 | --base-dir is not presented, adjusting uri . relative to
/Users/calebanderson/Documents/source/lyceum/ellie-api/functions/split_pdfs/.aws-sam/build/template.yaml
2025-01-08 10:33:33,396 | Skip Building LambdaFunction function, as it is missing either Dockerfile or DockerContext metadata properties.
2025-01-08 10:33:33,402 | Found one Lambda function with name 'LambdaFunction'
2025-01-08 10:33:33,403 | Invoking Container created from pdf-splitter:latest
2025-01-08 10:33:33,403 | Loading AWS credentials from session with profile 'None'
2025-01-08 10:33:33,408 | Code None is not a zip/jar file
2025-01-08 10:33:33,414 | Local image was not found.
2025-01-08 10:33:33,415 | Removing rapid images for repo pdf-splitter
Building image.........
2025-01-08 10:33:33,633 | Failed to build Docker Image

Expected result:

I would expect that SAM is able to properly locate the docker image and build my lambda function with that.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Mac OS sequoia 15.1.1 (arm64)
  2. sam --version: 1.132.0
  3. AWS region: us-east-1
{
  "version": "1.132.0",
  "system": {
    "python": "3.11.10",
    "os": "macOS-15.1.1-arm64-arm-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "27.3.1",
    "aws_cdk": "Not available",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dockerblocked/more-info-neededMore info is needed from the requester. If no response in 14 days, it will become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions