AWS CDK Python docker throwing invalid bind mount error when trying to bundle code

0

I'm trying to deploy a python lambda function with dependencies and I'm getting an error from the docker daemon (on Centos linux) that there is an invalid bind mount spec. The error is "/path//to/my/code:/asset-input:z,delegated": invalid mode: delegated

The following is what my code looks like for the lambda function:

        python_function = Function(
            self,
            id="PythonFunction",
            runtime=Runtime.PYTHON_3_9,
            handler="app.main.lambda_handler",
            timeout=Duration.seconds(20),
            code=Code.from_asset(
                path=str(python_function_path.resolve()),
                bundling=BundlingOptions(
                    image=Runtime.PYTHON_3_9.bundling_image,
                    command=[
                        "bash",
                        "-c",
                        "pip install -r requirements.txt -t /asset-output && cp -au . /asset-output",
                    ],
                ),
            ),
            memory_size=128,
            log_retention=RetentionDays.TWO_WEEKS,
        )

This works just fine on my Mac, but trying to deploy from Centos is unsuccessful.

1

1

Your docker version is out of date. You need to be running docker CE at least version 1.17.04 or higher (this was the version when support for delegated mode was added, but ideally you should install a more recent version).

As stated in comments, your current version is 1.13.1, which does not have support for this mode.

To resolve this, you should update your docker version.

2021-11-24 03:47:15

This ended up fixing the issue I was having. Thanks a ton.
Jasonca1

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................