Skip to content

sam local invoke with pre-built image #7993

@hikouki-gumo

Description

@hikouki-gumo

Description

My function uses dependencies from a private Github repository and I have to --mount feature of BuildKit to build Docker image, but SAM does not support BuildKit. Then I have to build image separately first and then define that pre-built image in field ImageUri of template.yaml.

Issue happens when I test on local, SAM must build on fly image to run function -> It can not build image, then can not invoke local.

Is there any way to invoke sam local for this use case? Or SAM does not support that?

AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31

Resources:
  FormDataExtractionFunction:
    # No MetaData definition
    Type: AWS::Serverless::Function
    Properties:
      FunctionName: "my-lambda-function"
      PackageType: Image
      ImageUri: "library/test-lambda:latest" # Specify local image

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked/close-if-inactiveBlocked for >14 days with no response, will be closed if still inactive after 7 days

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions