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

WIP feat(docker-local): improve local docker configuration for quickstart #46

Merged
merged 22 commits into from
Mar 17, 2024

Conversation

fynnfluegge
Copy link
Owner

@fynnfluegge fynnfluegge commented May 4, 2023

sam build and sam local start-api with docker-compose are starting up smoothly:

rocketnotes-api  | 2023-05-06 10:11:01,739 | Localhost server is starting up. Multi-threading = True
rocketnotes-api  | 2023-05-06 10:11:01 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
rocketnotes-api  |  * Running on all addresses (0.0.0.0)
rocketnotes-api  |  * Running on http://127.0.0.1:3002
rocketnotes-api  |  * Running on http://172.26.0.2:3002
rocketnotes-api  | 2023-05-06 10:11:01 Press CTRL+C to quit

But once requesting a lambda handler via http request it throws:

rocketnotes-api  | 2023-05-06 10:11:55,706 | Found one Lambda function with name 'getDocumentFunction'
rocketnotes-api  | 2023-05-06 10:11:55,706 | Invoking get-document-handler (go1.x)
rocketnotes-api  | 2023-05-06 10:11:55,707 | Loading AWS credentials from session with profile 'None'
rocketnotes-api  | 2023-05-06 10:11:55,799 | Resolving code path. Cwd=/var/task/.aws-sam/build, CodeUri=getDocumentFunction
rocketnotes-api  | 2023-05-06 10:11:55,799 | Resolved absolute path to code is /var/task/.aws-sam/build/getDocumentFunction
rocketnotes-api  | 2023-05-06 10:11:55,800 | Code /var/task/.aws-sam/build/getDocumentFunction is not a zip/jar file
rocketnotes-api  | 2023-05-06 10:11:58,393 | Local image is up-to-date
rocketnotes-api  | 2023-05-06 10:11:58,473 | Using local image: public.ecr.aws/lambda/go:1-rapid-x86_64.
rocketnotes-api  |
rocketnotes-api  | 2023-05-06 10:11:58,474 | Mounting /var/task/.aws-sam/build/getDocumentFunction as /var/task:ro,delegated, inside runtime container
rocketnotes-api  | bash: line 1:  3158 Segmentation fault      sam local start-api --host 0.0.0.0 --container-host host.docker.internal --port 3002 --docker-volume-basedir /var/task/.aws-sam/build --debug
rocketnotes-api exited with code 139

Seems that mounting the sam-build source code from the host into the container started by sam cli causes the error.

@fynnfluegge fynnfluegge marked this pull request as draft May 15, 2023 18:49
@fynnfluegge fynnfluegge changed the title feat(docker-local): improve local docker configuration for quickstart WIP feat(docker-local): improve local docker configuration for quickstart Mar 3, 2024
@fynnfluegge
Copy link
Owner Author

Possible solution aws/aws-sam-cli#55

@fynnfluegge fynnfluegge marked this pull request as ready for review March 4, 2024 10:32
@fynnfluegge fynnfluegge marked this pull request as draft March 4, 2024 10:32
@fynnfluegge fynnfluegge marked this pull request as ready for review March 17, 2024 11:09
@fynnfluegge fynnfluegge merged commit d443943 into main Mar 17, 2024
1 check passed
@fynnfluegge fynnfluegge deleted the feat/local_docker_setup branch March 17, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft help wanted Extra attention is needed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant