air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.53k stars 779 forks source link

Docker air:/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by air) #415

Closed anderson-comvex closed 9 months ago

anderson-comvex commented 1 year ago

Description

Air Version: v1.43

On AMD64 CPU Architectures of Mac Intel, the image is built successfully but when trying to run the container we get air: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by air)`.

Tried both Go 1.19 and 1.20.

Air is being installed using:

RUN curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

Additional Details

It looks like the gclib of the images are 2.31 tho when running: find /lib -iname 'libc*.so'

/lib/x86_64-linux-gnu/libc-2.31.so

But for ARM64 on Mac Silicon, seems to be running fine with the libc-2.31

Workaround

Lock the version to v1.42 or before.

arckadious commented 1 year ago

Same issue here, I tried to downgrade air version, but still the same: GLIBC_2.32' not found (required by air). Any ideas ?

EDIT : I found a solution. I used debian:latest docker image and I was using air, inside. You can use debian:bookworm (not yet stable), or use comstrek/air image directly.

silverwind commented 1 year ago

Try the go install method.

feline-fanatic commented 1 year ago

@anderson-comvex I am getting the same issue with v1.42. What base image are you using in your dockerfile?

giolazzareschi commented 1 year ago

This is my Dockerfile - working in Windows 11 WSL2

FROM golang:latest as base

FROM base as dev

RUN go install github.com/cosmtrek/air@latest

WORKDIR /opt/app/api

CMD ["air"]
anderson-comvex commented 1 year ago

@anderson-comvex I am getting the same issue with v1.42. What base image are you using in your dockerfile?

@feline-fanatic I added the Docker image from Dockerhub we are using as base image on the Issue Description.

silverwind commented 1 year ago

The fix is likely to build the app with CGO_ENABLED=0, assuming no CGO dependencies which will produce a static binary.

I think something in go has changed where it no longer produces static binaries by default, and insteads builds with the shitty CGO toolchain.

veritymedia commented 11 months ago

Had same issues even now. go install worked, curl gave the error

xiantang commented 9 months ago

https://github.com/cosmtrek/air/pull/450 I think this PR should fixed