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

Cannot install Go in Lambda container #4

Open
roboli opened this issue Feb 24, 2023 · 1 comment
Open

Cannot install Go in Lambda container #4

roboli opened this issue Feb 24, 2023 · 1 comment

Comments

@roboli
Copy link
Contributor

roboli commented Feb 24, 2023

I'm running the next command from Chapter 8:

docker compose -f docker-compose.yaml -f newsletter-lambda/docker-compose.yaml up

But it hangs and throws this:

[build 2/8] RUN yum install -y golang  
=> => # http://packages.us-west-2.amazonaws.com/2018.03/main/c31535f74c6e/x86_64/Packages/cpp72-7.2.1-2.59.amzn1.x86_64.rpm?instance_id=URLError&region=None: [Errno 12] Timeout on http://packages.us-we
 => => # st-2.amazonaws.com/2018.03/main/c31535f74c6e/x86_64/Packages/cpp72-7.2.1-2.59.amzn1.x86_64.rpm?instance_id=URLError&region=None: (28, 'Resolving timed out after 5000 milliseconds')             
 => => # Trying other mirror. 
                                                                                                                                                                            
 => => # http://packages.us-west-2.amazonaws.com/2018.03/updates/48f68d9058af/x86_64/Packages/git-2.38.3-1.78.amzn1.x86_64.rpm?instance_id=URLError&region=None: [Errno 12] Timeout on http://packages.us-
 => => # west-2.amazonaws.com/2018.03/updates/48f68d9058af/x86_64/Packages/git-2.38.3-1.78.amzn1.x86_64.rpm?instance_id=URLError&region=None: (28, 'Resolving timed out after 5000 milliseconds')         
 => => # Trying other mirror.

Any idea how to solve this? Thanks.

@gkatzioura
Copy link
Collaborator

Hi @roboli I cannot reproduce this.
However since this might cause you issues I created an image that you can use
gkatzioura/guide-to-compose:chapter8-go-installed

Essentially you shall switch lambda Dockerfiles with that image that have go installed.
The Dockerfiles affected are newsletter-lambda/Dockerfile and s3store-lambda/Dockerfile.

FROM gkatzioura/guide-to-compose:chapter8-go-installed as build


COPY go.mod ./
COPY go.sum ./

RUN go mod download

COPY *.go ./

RUN go build -o /main

FROM amazon/aws-lambda-go:latest
COPY --from=build /main /var/task/main

CMD [ "main" ]

Let me know if this works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants