rails-lambda / lamby

🐑🛤 Simple Rails & AWS Lambda Integration
https://lamby.cloud
MIT License
601 stars 29 forks source link

invalid ELF header #118

Closed hopewise closed 1 year ago

hopewise commented 2 years ago

Running ./bin/bootstrap results into

aws: error while loading shared libraries: /usr/local/aws-cli/v2/2.4.20/dist/libz.so.1: invalid ELF header

full log:

./bin/bootstrap                                                                       SIG(124) ↵  10007  H:M:S
== Building containers ==
WARNING: The AWS_ACCESS_KEY_ID variable is not set. Defaulting to a blank string.
WARNING: The AWS_SECRET_ACCESS_KEY variable is not set. Defaulting to a blank string.
WARNING: The CI variable is not set. Defaulting to a blank string.
Building google-ads-api-lambda
[+] Building 1.0s (8/8) FINISHED                                                                                                                                                   
 => [internal] load build definition from Dockerfile-build                                                                                                                    0.0s
 => => transferring dockerfile: 43B                                                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                               0.0s
 => [internal] load metadata for public.ecr.aws/sam/build-ruby2.7:latest                                                                                                      0.9s
 => [1/4] FROM public.ecr.aws/sam/build-ruby2.7@sha256:caed6d5ed272c6a9973965a909d0d0a0447447698dfed45                                                       0.0s
 => CACHED [2/4] RUN mkdir /lamby     && /usr/sbin/groupadd --gid 0 --system --force lamby     && /usr/sbin/useradd --uid 0 --gid 0 --non-unique --home-dir /lamby --shell /  0.0s
 => CACHED [3/4] RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - &&     yum install -y nodejs &&     curl --silent --location https://dl.yarnpkg.com/rpm/yarn.re  0.0s
 => CACHED [4/4] WORKDIR /var/task                                                                                                                                            0.0s
 => exporting to image                                                                                                                                                        0.0s
 => => exporting layers                                                                                                                                                       0.0s
 => => writing image sha256:81240fa31cfd3f25ae649da5b1b03200847f6091b20a0b1c4                                                                                  0.0s
 => => naming to docker.io/library/google_ads_api_service_google-ads-api-lambda                                                                                               0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
WARNING: The AWS_ACCESS_KEY_ID variable is not set. Defaulting to a blank string.
WARNING: The AWS_SECRET_ACCESS_KEY variable is not set. Defaulting to a blank string.
WARNING: The CI variable is not set. Defaulting to a blank string.
Creating google_ads_api_service_google-ads-api-lambda_run ... done
== Creating ECR repository, if needed. ==
== Ignore any RepositoryAlreadyExistsException errors ==
aws: error while loading shared libraries: /usr/local/aws-cli/v2/2.4.20/dist/libz.so.1: invalid ELF header

Any idea?

andy4thehuynh commented 2 years ago

Any resolution fixing WARNING: The AWS_ACCESS_KEY_ID variable is not set. Defaulting to a blank string.?

metaskills commented 2 years ago

So that is just a warning and what I would like to do is completely overhaul and split up the local development and CI/CD pipeline which would avoid this warning. Basically I'd like to use the .devcontainer spec.

metaskills commented 1 year ago

I recently refactored the Lamby Cookiecutter to follow this pattern and outlined all the changes. It actually simplifies a lot. Review here: