Skip to content
New issue

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

Ability to run docker command in build pipeline #3992

Open
3 tasks done
cBiscuitSurprise opened this issue Feb 12, 2025 · 1 comment
Open
3 tasks done

Ability to run docker command in build pipeline #3992

cBiscuitSurprise opened this issue Feb 12, 2025 · 1 comment
Labels
feature-request New feature or request

Comments

@cBiscuitSurprise
Copy link

Before opening, please confirm:

Amplify Hosting feature

Build settings

Is your feature request related to a problem? Please describe:

We need the ability to build docker images in the build step of the amplify pipeline. I'm currently trying to build a python 3.13 function, but the version in the build image is 3.10. An easy workaround would be to allow for something like:

      new Function(scope, id, {
        handler,
        functionName: name,
        runtime: Runtime.PYTHON_3_13,
        timeout: Duration.minutes(15),
        code: Code.fromAsset(functionDir, {
          bundling: {
            image: DockerImage.fromRegistry(
              "public.ecr.aws/docker/library/python:3.13"
            ),
            user: "0:0",
            entrypoint: ["/bin/bash"],
            command: [
              "-c",
              [
                "python3 -m pip install /asset-input -t /asset-output",
                "..."
              ].join(" && "),
            ],
          },
        }),

But this fails in the amplify pipeline with:

2025-02-12T22:33:20.577Z [INFO]: CustomFunctionProviderDockerError: Failed to instantiate custom function provider

Resolution: See https://docs.amplify.aws/react/build-a-backend/functions/custom-functions for more details about current limitations and troubleshooting steps.

Cause: Failed to bundle asset amplify-d36fq56lkpqjkv-dev-branch-cce3d3c6f0/function/payerTocReportinPlans/Code/Stage, bundle output is located at /codebuild/output/src4059803044/src/campaign-healthcare-web/.amplify/artifacts/cdk.out/asset.93520a826d8fa364dac7c7e5dab567f2455cba43ffe272a9ff765306c840c9de-error: Error: spawnSync docker ENOENT

The docs mention this error, but don't address it in this context (build time). At this point my only options appear to be 1) live at the mercy of the built-in python version which can change without warning and will be perpetually out of date 2) build a custom Amplify image where I need to take on the management of Amplify build-time dependencies which is not my scope.

Describe how you'd like this feature to work

Allow for docker-in-docker during amplify build or expand the available custom library overrides to include python (and maintain a current list of LTS python versions).

@cBiscuitSurprise cBiscuitSurprise added the feature-request New feature or request label Feb 12, 2025
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant