Repository: aws/sagemaker-python-sdk

Issue:
Add possibility of opening additional ports for Local Mode
**Describe the feature you'd like**
Currently Local Mode does not allow opening any additional ports. This is problematic, since I can't connect to any databases, which renders some processors, e.g. PySparkProcessor, quite useless for me.

**How would this feature be used? Please describe.**
Pass additional arguments to `LocalSession` configuration, with list of ports to expose, e.g. `9200:9200`, so that it will be translated to config `ports: 9200:9200`.


Discussion:
sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: ace82403c3f47940919d4666f5ee9b4546220540
* Result: FAILED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=6732b107-abb8-40d6-8591-7ac1d36927d6%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: ace82403c3f47940919d4666f5ee9b4546220540
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=ad6c9ee4-4b27-432f-8401-daddb5a6f8a5%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: ace82403c3f47940919d4666f5ee9b4546220540
* Result: FAILED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=8a091287-b7bf-4a76-bea2-b0dfcf85d8f2%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: ace82403c3f47940919d4666f5ee9b4546220540
* Result: FAILED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=879f30ec-d627-45ad-af7d-ce6039ff0327%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: e6a8d85dc353d35807c7e30ce67706319198b322
* Result: FAILED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=8bf7f836-a3df-4899-a448-6c82033101e7%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: e6a8d85dc353d35807c7e30ce67706319198b322
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=27f122e2-73ee-4d16-b1f4-fa14394b2ea0%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: e6a8d85dc353d35807c7e30ce67706319198b322
* Result: SUCCEEDED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=e3765bee-2f45-4fd9-9033-55b594f8c638%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: e6a8d85dc353d35807c7e30ce67706319198b322
* Result: FAILED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=00a22ae4-8641-4ef2-997a-94bd1fe8dccb%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: e6a8d85dc353d35807c7e30ce67706319198b322
* Result: FAILED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=ed25eaa2-80bf-427a-8cd0-08ff42fdd265%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 40dba746b7f8aca54ebd22eb7d67eafb50fc8fd5
* Result: FAILED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=8dbb68fc-4923-4584-a556-0736462b09b7%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 1f86451a418a9900d1fe60ba30bc0913b3e31dce
* Result: SUCCEEDED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=6c603431-9302-4aab-8e9b-e0a1198951e0%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: 1f86451a418a9900d1fe60ba30bc0913b3e31dce
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=3254a94d-2f5f-41f2-92b9-561acbae8437%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: 1f86451a418a9900d1fe60ba30bc0913b3e31dce
* Result: FAILED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=5887dc0e-7916-4ace-b7e4-976d8a14a332%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 1f86451a418a9900d1fe60ba30bc0913b3e31dce
* Result: SUCCEEDED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=e62d18e7-52c5-48cd-8be1-ac85f76f1a6a%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 891e8ebd03a63ad105f4f4ca66a8e5f6310e786c
* Result: SUCCEEDED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=1d60e386-464e-4224-8379-e981a27b6dc0%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: 891e8ebd03a63ad105f4f4ca66a8e5f6310e786c
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=7b710587-bbe8-4888-bf40-e2d2a7f3b1fa%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 891e8ebd03a63ad105f4f4ca66a8e5f6310e786c
* Result: SUCCEEDED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=057c85a9-ca54-4723-9b03-fb3f7dc5c78e%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: 891e8ebd03a63ad105f4f4ca66a8e5f6310e786c
* Result: SUCCEEDED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=410c1418-5b47-4964-b882-73f3a370528d%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: 891e8ebd03a63ad105f4f4ca66a8e5f6310e786c
* Result: FAILED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=ac876ce9-a3a1-40f1-9e67-02b8ab3780fa%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 0f8df75c5473314c5d115a60e73134a415481f1a
* Result: FAILED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=45ffa8f8-59f7-4787-a453-849185164add%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 0f8df75c5473314c5d115a60e73134a415481f1a
* Result: FAILED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=56119e96-0aef-456e-80f3-138c4b063f34%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: 0f8df75c5473314c5d115a60e73134a415481f1a
* Result: SUCCEEDED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=80f181b7-93ae-48c3-b87c-214d079ea201%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: 0f8df75c5473314c5d115a60e73134a415481f1a
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=b044fafe-a6b5-436b-a25a-bc2b52b1454c%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 457a740aefb8cb6f051bf88e7ab6cddb7261d6f1
* Result: FAILED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=5dbab672-8a27-4002-b1ea-728eb5c13cdb%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 457a740aefb8cb6f051bf88e7ab6cddb7261d6f1
* Result: SUCCEEDED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=be755701-5a66-4fed-b690-a4f17e285946%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: 457a740aefb8cb6f051bf88e7ab6cddb7261d6f1
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=4719da7b-8aea-485b-ab7c-c5e58774ab1d%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: 457a740aefb8cb6f051bf88e7ab6cddb7261d6f1
* Result: SUCCEEDED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=58c8563b-aa2f-47f9-a650-dc42e2376ce5%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: 457a740aefb8cb6f051bf88e7ab6cddb7261d6f1
* Result: FAILED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=ec207294-5113-4498-b371-4811d9c08f7b%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 81d1046cb9a5c6ecf62d2eda3c006298794296f1
* Result: SUCCEEDED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=8dddd106-289b-4f3b-ba1a-50f5e3abb995%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: 81d1046cb9a5c6ecf62d2eda3c006298794296f1
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=999ed05c-e29a-4a6f-905e-0e3819b5bdcf%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: 81d1046cb9a5c6ecf62d2eda3c006298794296f1
* Result: SUCCEEDED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=b2657a5c-9a5a-4d52-aef9-37b40270ff17%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: 81d1046cb9a5c6ecf62d2eda3c006298794296f1
* Result: SUCCEEDED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=37f15014-cd61-4b66-b86e-45136234ef85%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 81d1046cb9a5c6ecf62d2eda3c006298794296f1
* Result: SUCCEEDED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=103d2c0c-117d-4545-9fc7-18306f71e371%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: c71eebb9974117b608a46439f72710afec1dc73b
* Result: FAILED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=1a8839ef-c0fe-4ff0-ad1a-3a560db55645%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: c71eebb9974117b608a46439f72710afec1dc73b
* Result: SUCCEEDED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=f6ad8bfb-52a2-449c-8274-2e2b87a8386d%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: c71eebb9974117b608a46439f72710afec1dc73b
* Result: SUCCEEDED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=4d17f5eb-d9c1-4a85-aa8b-bd93c31ff2ee%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: c71eebb9974117b608a46439f72710afec1dc73b
* Result: SUCCEEDED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=9a836ae1-9d1a-4c44-b8af-cf16eec2e97e%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 328a9ad71721081f002708cb061766ac0bead641
* Result: FAILED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=e488ef0f-3f3e-4719-a93d-2da97fa6f6f4%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: 328a9ad71721081f002708cb061766ac0bead641
* Result: FAILED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=bdf84f60-f9eb-4ffe-a862-1f3175dcaedd%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 328a9ad71721081f002708cb061766ac0bead641
* Result: SUCCEEDED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=ff3bc6b6-84f5-44b0-8b22-9b626e8f080b%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 33a18037c8b71271ff333e4798aac306fd449229
* Result: FAILED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=4ad67dc4-1697-4026-bf1c-81a46e9c8fbe%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 7dcc1f6cc3a05fa104c981205b301be5e80e9635
* Result: FAILED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=9e0d8f2c-caaa-473b-9b0b-0019e4dde42f%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-local-mode-tests
* Commit ID: 9233947bd70f1ddb01257ba334bf3daae447072a
* Result: SUCCEEDED
* [Build Logs](https://8huhkqo601.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=e02c12c2-6dcf-4391-bb89-0e9257c1dfa4%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-notebook-tests
* Commit ID: 9233947bd70f1ddb01257ba334bf3daae447072a
* Result: SUCCEEDED
* [Build Logs](https://bkqkixfb59.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=ca98e24e-9f94-4126-b095-6969681f8176%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-slow-tests
* Commit ID: 9233947bd70f1ddb01257ba334bf3daae447072a
* Result: SUCCEEDED
* [Build Logs](https://omfrydptb9.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=55d37695-95e3-4689-b133-106045f4df76%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-pr
* Commit ID: 9233947bd70f1ddb01257ba334bf3daae447072a
* Result: SUCCEEDED
* [Build Logs](https://abkt2mlh3k.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=9fb1c405-e029-4d08-9660-f0e34733d2e8%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->


sagemaker-bot: 
### AWS CodeBuild CI Report

* CodeBuild project: sagemaker-python-sdk-unit-tests
* Commit ID: 9233947bd70f1ddb01257ba334bf3daae447072a
* Result: SUCCEEDED
* [Build Logs](https://fegcnxu6da.execute-api.us-west-2.amazonaws.com/Prod/buildlogs?key=5a3e1e07-16d9-4a50-af79-ac288fa77c39%2Fbuild.log) (available for 30 days)

*Powered by [github-codebuild-logs](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:277187709615:applications~github-codebuild-logs), available on the [AWS Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/)*


<!--
CREATED BY GITHUB-CODEBUILD-LOGS
-->



Patch:
diff --git a/doc/overview.rst b/doc/overview.rst
index b75370e7..9612a233 100644
--- a/doc/overview.rst
+++ b/doc/overview.rst
@@ -1560,9 +1560,20 @@ You can install necessary dependencies for this feature using pip.
 Additionally, Local Mode also requires Docker Compose V2. Follow the guidelines in https://docs.docker.com/compose/install/ to install.
 Make sure to have a Compose Version compatible with your Docker Engine installation. Check Docker Engine release notes https://docs.docker.com/engine/release-notes to find a compatible version.
 
-If you want to keep everything local, and not use Amazon S3 either, you can enable "local code" in one of two ways:
+Local mode configuration
+========================
 
-- Create a file at ``~/.sagemaker/config.yaml`` that contains:
+The local mode uses a YAML configuration file located at ``~/.sagemaker/config.yaml`` to define the default values that are automatically passed to the ``config`` attribute of ``LocalSession``. This is an example of the configuration, for the full schema, see `sagemaker.config.config_schema.SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA <https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/config/config_schema.py>`_.
+
+.. code:: yaml
+
+    local:
+        local_code: true # Using everything locally
+        region_name: "us-west-2" # Name of the region
+        container_config: # Additional docker container config
+            shm_size: "128M
+
+If you want to keep everything local, and not use Amazon S3 either, you can enable "local code" in one of two ways:
 
 .. code:: yaml
 
@@ -1583,6 +1594,9 @@ If you want to keep everything local, and not use Amazon S3 either, you can enab
 .. note::
     If you enable "local code," then you cannot use the ``dependencies`` parameter in your estimator or model.
 
+Activating local mode by ``instance_type`` argument
+====================================================
+
 We can take the example in  `Using Estimators <#using-estimators>`__ , and use either ``local`` or ``local_gpu`` as the instance type.
 
 .. code:: python
diff --git a/src/sagemaker/config/__init__.py b/src/sagemaker/config/__init__.py
index 0498e7c2..e73ef770 100644
--- a/src/sagemaker/config/__init__.py
+++ b/src/sagemaker/config/__init__.py
@@ -13,7 +13,11 @@
 """This module configures the default values for SageMaker Python SDK."""
 
 from __future__ import absolute_import
-from sagemaker.config.config import load_sagemaker_config, validate_sagemaker_config  # noqa: F401
+from sagemaker.config.config import (  # noqa: F401
+    load_local_mode_config,
+    load_sagemaker_config,
+    validate_sagemaker_config,
+)
 from sagemaker.config.config_schema import (  # noqa: F401
     KEY,
     TRAINING_JOB,
@@ -161,4 +165,8 @@ from sagemaker.config.config_schema import (  # noqa: F401
     INFERENCE_SPECIFICATION,
     ESTIMATOR,
     DEBUG_HOOK_CONFIG,
+    SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA,
+    LOCAL,
+    LOCAL_CODE,
+    CONTAINER_CONFIG,
 )
diff --git a/src/sagemaker/config/config.py b/src/sagemaker/config/config.py
index 3beb9dfe..e9af132c 100644
--- a/src/sagemaker/config/config.py
+++ b/src/sagemaker/config/config.py
@@ -16,7 +16,7 @@ It supports loading config files from the local file system and Amazon S3.
 The schema of the config file is dictated in config_schema.py in the same module.
 
 """
-from __future__ import absolute_import
+from __future__ import absolute_import, annotations
 
 import pathlib
 import os
@@ -33,12 +33,18 @@ from sagemaker.config.config_utils import get_sagemaker_config_logger
 logger = get_sagemaker_config_logger()
 
 _APP_NAME = "sagemaker"
+# The default name of the config file.
+_CONFIG_FILE_NAME = "config.yaml"
 # The default config file location of the Administrator provided config file. This path can be
 # overridden with `SAGEMAKER_ADMIN_CONFIG_OVERRIDE` environment variable.
-_DEFAULT_ADMIN_CONFIG_FILE_PATH = os.path.join(site_config_dir(_APP_NAME), "config.yaml")
+_DEFAULT_ADMIN_CONFIG_FILE_PATH = os.path.join(site_config_dir(_APP_NAME), _CONFIG_FILE_NAME)
 # The default config file location of the user provided config file. This path can be
 # overridden with `SAGEMAKER_USER_CONFIG_OVERRIDE` environment variable.
-_DEFAULT_USER_CONFIG_FILE_PATH = os.path.join(user_config_dir(_APP_NAME), "config.yaml")
+_DEFAULT_USER_CONFIG_FILE_PATH = os.path.join(user_config_dir(_APP_NAME), _CONFIG_FILE_NAME)
+# The default config file location of the local mode.
+_DEFAULT_LOCAL_MODE_CONFIG_FILE_PATH = os.path.join(
+    os.path.expanduser("~"), ".sagemaker", _CONFIG_FILE_NAME
+)
 
 ENV_VARIABLE_ADMIN_CONFIG_OVERRIDE = "SAGEMAKER_ADMIN_CONFIG_OVERRIDE"
 ENV_VARIABLE_USER_CONFIG_OVERRIDE = "SAGEMAKER_USER_CONFIG_OVERRIDE"
@@ -144,11 +150,21 @@ def validate_sagemaker_config(sagemaker_config: dict = None):
     jsonschema.validate(sagemaker_config, SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA)
 
 
+def load_local_mode_config() -> dict | None:
+    """Loads the local mode config file."""
+    try:
+        content = _load_config_from_file(_DEFAULT_LOCAL_MODE_CONFIG_FILE_PATH)
+    except ValueError:
+        content = None
+
+    return content
+
+
 def _load_config_from_file(file_path: str) -> dict:
     """Placeholder docstring"""
     inferred_file_path = file_path
     if os.path.isdir(file_path):
-        inferred_file_path = os.path.join(file_path, "config.yaml")
+        inferred_file_path = os.path.join(file_path, _CONFIG_FILE_NAME)
     if not os.path.exists(inferred_file_path):
         raise ValueError(
             f"Unable to load the config file from the location: {file_path}"
@@ -194,10 +210,14 @@ def _get_inferred_s3_uri(s3_uri, s3_resource_for_config):
     if len(s3_files_with_same_prefix) > 1:
         # Customer has provided us with a S3 URI which points to a directory
         # search for s3://<bucket>/directory-key-prefix/config.yaml
-        inferred_s3_uri = str(pathlib.PurePosixPath(s3_uri, "config.yaml")).replace("s3:/", "s3://")
+        inferred_s3_uri = str(pathlib.PurePosixPath(s3_uri, _CONFIG_FILE_NAME)).replace(
+            "s3:/", "s3://"
+        )
         if inferred_s3_uri not in s3_files_with_same_prefix:
             # We don't know which file we should be operating with.
-            raise ValueError("Provide an S3 URI of a directory that has a config.yaml file.")
+            raise ValueError(
+                f"Provide an S3 URI of a directory that has a {_CONFIG_FILE_NAME} file."
+            )
         # Customer has a config.yaml present in the directory that was provided as the S3 URI
         return inferred_s3_uri
     return s3_uri
diff --git a/src/sagemaker/config/config_schema.py b/src/sagemaker/config/config_schema.py
index f4857258..a2e99ac1 100644
--- a/src/sagemaker/config/config_schema.py
+++ b/src/sagemaker/config/config_schema.py
@@ -102,6 +102,11 @@ PROFILER_CONFIG = "ProfilerConfig"
 DISABLE_PROFILER = "DisableProfiler"
 ESTIMATOR = "Estimator"
 DEBUG_HOOK_CONFIG = "DebugHookConfig"
+LOCAL = "local"
+LOCAL_CODE = "local_code"
+SERVING_PORT = "serving_port"
+CONTAINER_CONFIG = "container_config"
+REGION_NAME = "region_name"
 
 
 def _simple_path(*args: str):
@@ -1068,3 +1073,28 @@ SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA = {
         },
     },
 }
+
+SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA = {
+    "$schema": "https://json-schema.org/draft/2020-12/schema",
+    TYPE: OBJECT,
+    ADDITIONAL_PROPERTIES: False,
+    PROPERTIES: {
+        LOCAL: {
+            TYPE: OBJECT,
+            ADDITIONAL_PROPERTIES: False,
+            PROPERTIES: {
+                LOCAL_CODE: {
+                    TYPE: "boolean",
+                },
+                REGION_NAME: {TYPE: "string"},
+                SERVING_PORT: {
+                    TYPE: "integer",
+                },
+                CONTAINER_CONFIG: {
+                    TYPE: OBJECT,
+                },
+            },
+        },
+    },
+    "required": [LOCAL],
+}
diff --git a/src/sagemaker/local/data.py b/src/sagemaker/local/data.py
index 68bc5d81..226ce35c 100644
--- a/src/sagemaker/local/data.py
+++ b/src/sagemaker/local/data.py
@@ -69,7 +69,7 @@ def get_splitter_instance(split_type):
     Returns
         :class:`sagemaker.local.data.Splitter`: an Instance of a Splitter
     """
-    if split_type is None:
+    if split_type == "None" or split_type is None:
         return NoneSplitter()
     if split_type == "Line":
         return LineSplitter()
diff --git a/src/sagemaker/local/image.py b/src/sagemaker/local/image.py
index ce5e08a4..fac15105 100644
--- a/src/sagemaker/local/image.py
+++ b/src/sagemaker/local/image.py
@@ -11,7 +11,7 @@
 # ANY KIND, either express or implied. See the License for the specific
 # language governing permissions and limitations under the License.
 """Placeholder docstring"""
-from __future__ import absolute_import
+from __future__ import absolute_import, annotations
 
 import base64
 import copy
@@ -32,9 +32,11 @@ import tempfile
 
 from distutils.spawn import find_executable
 from threading import Thread
+from typing import Dict, List
 from six.moves.urllib.parse import urlparse
 
 import sagemaker
+from sagemaker.config.config_schema import CONTAINER_CONFIG, LOCAL
 import sagemaker.local.data
 import sagemaker.local.utils
 import sagemaker.utils
@@ -769,15 +771,22 @@ class _SageMakerContainer(object):
         logger.info("docker command: %s", " ".join(compose_cmd))
         return compose_cmd
 
-    def _create_docker_host(self, host, environment, optml_subdirs, command, volumes):
+    def _create_docker_host(
+        self,
+        host: str,
+        environment: List[str],
+        optml_subdirs: set[str],
+        command: str,
+        volumes: List,
+    ) -> Dict:
         """Creates the docker host configuration.
 
         Args:
-            host:
-            environment:
-            optml_subdirs:
-            command:
-            volumes:
+            host (str): The host address
+            environment (List[str]): List of environment variables
+            optml_subdirs (Set[str]): Set of subdirs
+            command (str): Either 'train' or 'serve'
+            volumes (list): List of volumes that will be mapped to the containers
         """
         optml_volumes = self._build_optml_volumes(host, optml_subdirs)
         optml_volumes.extend(volumes)
@@ -785,8 +794,15 @@ class _SageMakerContainer(object):
         container_name_prefix = "".join(
             random.choice(string.ascii_lowercase + string.digits) for _ in range(10)
         )
+        container_default_config = (
+            sagemaker.utils.get_config_value(
+                f"{LOCAL}.{CONTAINER_CONFIG}", self.sagemaker_session.config
+            )
+            or {}
+        )
 
         host_config = {
+            **container_default_config,
             "image": self.image,
             "container_name": f"{container_name_prefix}-{host}",
             "stdin_open": True,
diff --git a/src/sagemaker/local/local_session.py b/src/sagemaker/local/local_session.py
index d21e12d8..d3ce0ea2 100644
--- a/src/sagemaker/local/local_session.py
+++ b/src/sagemaker/local/local_session.py
@@ -11,21 +11,24 @@
 # ANY KIND, either express or implied. See the License for the specific
 # language governing permissions and limitations under the License.
 """Placeholder docstring"""
-from __future__ import absolute_import
+from __future__ import absolute_import, annotations
 
 import logging
-import os
 import platform
 from datetime import datetime
+from typing import Dict
 
 import boto3
 from botocore.exceptions import ClientError
+import jsonschema
 
 from sagemaker.config import (
-    load_sagemaker_config,
-    validate_sagemaker_config,
+    SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA,
     SESSION_DEFAULT_S3_BUCKET_PATH,
     SESSION_DEFAULT_S3_OBJECT_KEY_PREFIX_PATH,
+    load_local_mode_config,
+    load_sagemaker_config,
+    validate_sagemaker_config,
 )
 from sagemaker.local.image import _SageMakerContainer
 from sagemaker.local.utils import get_docker_host
@@ -83,7 +86,7 @@ class LocalSagemakerClient(object):  # pylint: disable=too-many-public-methods
         Environment=None,
         ProcessingInputs=None,
         ProcessingOutputConfig=None,
-        **kwargs
+        **kwargs,
     ):
         """Creates a processing job in Local Mode
 
@@ -165,7 +168,7 @@ class LocalSagemakerClient(object):  # pylint: disable=too-many-public-methods
         ResourceConfig,
         InputDataConfig=None,
         Environment=None,
-        **kwargs
+        **kwargs,
     ):
         """Create a training job in Local Mode.
 
@@ -230,7 +233,7 @@ class LocalSagemakerClient(object):  # pylint: disable=too-many-public-methods
         TransformInput,
         TransformOutput,
         TransformResources,
-        **kwargs
+        **kwargs,
     ):
         """Create the transform job.
 
@@ -537,7 +540,21 @@ class LocalSagemakerRuntimeClient(object):
         self.http = urllib3.PoolManager()
         self.serving_port = 8080
         self.config = config
-        self.serving_port = get_config_value("local.serving_port", config) or 8080
+
+    @property
+    def config(self) -> dict:
+        """Local config getter"""
+        return self._config
+
+    @config.setter
+    def config(self, value: dict):
+        """Local config setter, this method also updates the `serving_port` attribute.
+
+        Args:
+            value (dict): the new config value
+        """
+        self._config = value
+        self.serving_port = get_config_value("local.serving_port", self._config) or 8080
 
     def invoke_endpoint(
         self,
@@ -686,6 +703,7 @@ class LocalSession(Session):
 
         self.sagemaker_client = LocalSagemakerClient(self)
         self.sagemaker_runtime_client = LocalSagemakerRuntimeClient(self.config)
+
         self.local_mode = True
         sagemaker_config = kwargs.get("sagemaker_config", None)
         if sagemaker_config:
@@ -726,17 +744,26 @@ class LocalSession(Session):
             sagemaker_session=self,
         )
 
-        local_mode_config_file = os.path.join(os.path.expanduser("~"), ".sagemaker", "config.yaml")
-        if os.path.exists(local_mode_config_file):
+        self.config = load_local_mode_config()
+        if self._disable_local_code and self.config and "local" in self.config:
+            self.config["local"]["local_code"] = False
+
+    @Session.config.setter
+    def config(self, value: Dict | None):
+        """Setter of the local mode config"""
+        if value is not None:
             try:
-                import yaml
-            except ImportError as e:
-                logger.error(_module_import_error("yaml", "Local mode", "local"))
+                jsonschema.validate(value, SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA)
+            except jsonschema.ValidationError as e:
+                logger.error("Failed to validate the local mode config")
                 raise e
+            self._config = value
+        else:
+            self._config = value
 
-            self.config = yaml.safe_load(open(local_mode_config_file, "r"))
-            if self._disable_local_code and "local" in self.config:
-                self.config["local"]["local_code"] = False
+        # update the runtime client on config changed
+        if getattr(self, "sagemaker_runtime_client", None):
+            self.sagemaker_runtime_client.config = self._config
 
     def logs_for_job(self, job_name, wait=False, poll=5, log_type="All"):
         """A no-op method meant to override the sagemaker client.
diff --git a/src/sagemaker/session.py b/src/sagemaker/session.py
index b202b2d0..554a3a05 100644
--- a/src/sagemaker/session.py
+++ b/src/sagemaker/session.py
@@ -11,7 +11,7 @@
 # ANY KIND, either express or implied. See the License for the specific
 # language governing permissions and limitations under the License.
 """Placeholder docstring"""
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import, annotations, print_function
 
 import json
 import logging
@@ -239,7 +239,7 @@ class Session(object):  # pylint: disable=too-many-public-methods
         self.s3_client = None
         self.resource_groups_client = None
         self.resource_group_tagging_client = None
-        self.config = None
+        self._config = None
         self.lambda_client = None
         self.settings = settings
 
@@ -326,6 +326,16 @@ class Session(object):  # pylint: disable=too-many-public-methods
             sagemaker_session=self,
         )
 
+    @property
+    def config(self) -> Dict | None:
+        """The config for the local mode, unused in a normal session"""
+        return self._config
+
+    @config.setter
+    def config(self, value: Dict | None):
+        """The config for the local mode, unused in a normal session"""
+        self._config = value
+
     @property
     def boto_region_name(self):
         """Placeholder docstring"""
diff --git a/tox.ini b/tox.ini
index d50d11b9..0b7a22e7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -42,6 +42,7 @@ ignore =
     FI55,
     FI56,
     FI57,
+    FI58,
     W503
 
 require-code = True


Test patch:
diff --git a/tests/unit/sagemaker/config/conftest.py b/tests/unit/sagemaker/config/conftest.py
index 1faeecbe..71a1fd1b 100644
--- a/tests/unit/sagemaker/config/conftest.py
+++ b/tests/unit/sagemaker/config/conftest.py
@@ -292,3 +292,15 @@ def s3_resource_mock():
 @pytest.fixture()
 def get_data_dir():
     return os.path.join(os.path.dirname(__file__), "..", "..", "..", "data", "config")
+
+
+@pytest.fixture()
+def base_local_mode_config():
+    return {
+        "local": {
+            "local_code": True,
+            "region_name": "",
+            "serving_port": 8080,
+            "container_config": {"shm_size": "128M"},
+        }
+    }
diff --git a/tests/unit/sagemaker/config/test_config.py b/tests/unit/sagemaker/config/test_config.py
index 54d236ea..7f5f045c 100644
--- a/tests/unit/sagemaker/config/test_config.py
+++ b/tests/unit/sagemaker/config/test_config.py
@@ -16,13 +16,15 @@ import os
 import pytest
 import yaml
 import logging
-from mock import Mock, MagicMock
+from mock import Mock, MagicMock, patch
 
 from sagemaker.config.config import (
+    load_local_mode_config,
     load_sagemaker_config,
     logger,
     _DEFAULT_ADMIN_CONFIG_FILE_PATH,
     _DEFAULT_USER_CONFIG_FILE_PATH,
+    _DEFAULT_LOCAL_MODE_CONFIG_FILE_PATH,
 )
 from jsonschema import exceptions
 from yaml.constructor import ConstructorError
@@ -402,3 +404,13 @@ def test_logging_with_additional_configs_and_none_are_found(caplog):
         in caplog.text
     )
     logger.propagate = False
+
+
+@patch("sagemaker.config.config._load_config_from_file")
+def test_load_local_mode_config(mock_load_config):
+    load_local_mode_config()
+    mock_load_config.assert_called_with(_DEFAULT_LOCAL_MODE_CONFIG_FILE_PATH)
+
+
+def test_load_local_mode_config_when_config_file_is_not_found():
+    assert load_local_mode_config() is None
diff --git a/tests/unit/sagemaker/config/test_config_schema.py b/tests/unit/sagemaker/config/test_config_schema.py
index 3ada30bb..aa0428d9 100644
--- a/tests/unit/sagemaker/config/test_config_schema.py
+++ b/tests/unit/sagemaker/config/test_config_schema.py
@@ -13,7 +13,10 @@
 from __future__ import absolute_import
 from jsonschema import validate, exceptions
 import pytest
-from sagemaker.config.config_schema import SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA
+from sagemaker.config.config_schema import (
+    SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA,
+    SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA,
+)
 
 
 def _validate_config(base_config_with_schema, sagemaker_config):
@@ -291,3 +294,19 @@ def test_session_s3_object_key_prefix_schema(base_config_with_schema, prefix_nam
 def test_invalid_session_s3_object_key_prefix_schema(base_config_with_schema, invalid_prefix_name):
     with pytest.raises(exceptions.ValidationError):
         test_session_s3_object_key_prefix_schema(base_config_with_schema, invalid_prefix_name)
+
+
+def test_validate_local_mode_schema(base_local_mode_config):
+    validate(base_local_mode_config, SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA)
+
+
+def test_validate_local_mode_schema_with_additional_key(base_local_mode_config):
+    config = dict(**base_local_mode_config)
+    config["foo"] = "bar"
+    with pytest.raises(exceptions.ValidationError):
+        validate(config, SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA)
+
+    config2 = dict(**base_local_mode_config)
+    config2["local"]["foo"] = "bar"
+    with pytest.raises(exceptions.ValidationError):
+        validate(config2, SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA)
diff --git a/tests/unit/sagemaker/local/test_local_image.py b/tests/unit/sagemaker/local/test_local_image.py
index 3aeda72d..5a236c60 100644
--- a/tests/unit/sagemaker/local/test_local_image.py
+++ b/tests/unit/sagemaker/local/test_local_image.py
@@ -657,6 +657,23 @@ def test_container_does_not_enable_nvidia_docker_for_cpu_containers(sagemaker_se
     assert "runtime" not in docker_host
 
 
+def test_container_with_custom_config(sagemaker_session):
+    custom_config = {
+        "local": {
+            "container_config": {"shm_size": "128M"},
+        }
+    }
+    sagemaker_session.config = custom_config
+    instance_count = 1
+    image = "my-image"
+    sagemaker_container = _SageMakerContainer(
+        "local", instance_count, image, sagemaker_session=sagemaker_session
+    )
+
+    docker_host = sagemaker_container._create_docker_host("host-1", {}, set(), "train", [])
+    assert "shm_size" in docker_host
+
+
 @patch("sagemaker.local.image._HostingContainer.run", Mock())
 @patch("sagemaker.local.image._SageMakerContainer._prepare_serving_volumes", Mock(return_value=[]))
 @patch("shutil.copy", Mock())
diff --git a/tests/unit/sagemaker/local/test_local_session.py b/tests/unit/sagemaker/local/test_local_session.py
index dc8cf393..ceae6747 100644
--- a/tests/unit/sagemaker/local/test_local_session.py
+++ b/tests/unit/sagemaker/local/test_local_session.py
@@ -11,6 +11,7 @@
 # ANY KIND, either express or implied. See the License for the specific
 # language governing permissions and limitations under the License.
 from __future__ import absolute_import
+import jsonschema
 
 import pytest
 import urllib3
@@ -1031,3 +1032,52 @@ def test_default_bucket_prefix_with_sagemaker_config(boto_session, client):
         **session_kwargs,
     )
     assert session_with_no_prefix.default_bucket_prefix is None
+
+
+VALID_LOCAL_MODE_CONFIG = {
+    "local": {
+        "local_code": True,
+        "serving_port": 8888,
+        "container_config": {"shm_size": "128M"},
+    }
+}
+
+INVALID_LOCAL_MODE_CONFIG = {
+    "locals": {
+        "local_code": True,
+        "serving_port": 8888,
+        "container_config": {"shm_size": "128M"},
+    }
+}
+
+
+@patch("sagemaker.local.local_session.load_local_mode_config", return_value=VALID_LOCAL_MODE_CONFIG)
+def test_config_getter(load_config_mock):
+    boto_session = Mock(region_name="us-west-2")
+    session = LocalSession(boto_session=boto_session)
+    load_config_mock.assert_called()
+    assert session.config == VALID_LOCAL_MODE_CONFIG
+
+
+@patch(
+    "sagemaker.local.local_session.load_local_mode_config", return_value=INVALID_LOCAL_MODE_CONFIG
+)
+def test_config_validation(load_config_mock):
+    boto_session = Mock(region_name="us-west-2")
+
+    with pytest.raises(jsonschema.ValidationError):
+        LocalSession(boto_session=boto_session)
+
+
+def test_config_setter():
+    boto_session = Mock(region_name="us-west-2")
+
+    session = LocalSession(boto_session=boto_session)
+    session.config = VALID_LOCAL_MODE_CONFIG
+    assert (
+        session.sagemaker_runtime_client.serving_port
+        == VALID_LOCAL_MODE_CONFIG["local"]["serving_port"]
+    )
+
+    with pytest.raises(jsonschema.ValidationError):
+        session.config = INVALID_LOCAL_MODE_CONFIG