lensesio / fast-data-dev

Kafka Docker for development. Kafka, Zookeeper, Schema Registry, Kafka-Connect, , 20+ connectors
https://lenses.io
Apache License 2.0
2.02k stars 332 forks source link

Apple M1 - Could not successfully bind to port 2181 #175

Open julianlecalvez opened 3 years ago

julianlecalvez commented 3 years ago

Hi ! I cope with an issue when I try to run the docker image on my Apple M1 mac (see the command and error below). At first, I tried to look for the port, which I was using because I have a zookeeper installation with brew, but after shutting it down, and even a restart, I still have this error. And if I run : lsof -nP -iTCP -sTCP:LISTEN | grep 2181, i get nothing. Now I'm thinking it's because of the new Apple M1 chips, because of the warning I get, but i'm not sure it's a common issue, and I'm not sure the actual error message can be related with ^^ Is there anything someone can think of that I can try ?

Thanks a lot !

$ docker run --rm --net=host lensesio/fast-data-dev

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc

runtime stack:
runtime.throw(0x512269, 0x9)
    /usr/lib/go/src/runtime/panic.go:566 +0x95
runtime.newosproc(0xc420030000, 0xc42003ffc0)
    /usr/lib/go/src/runtime/os_linux.go:160 +0x194
runtime.newm(0x5203a0, 0x0)
    /usr/lib/go/src/runtime/proc.go:1572 +0x132
runtime.main.func1()
    /usr/lib/go/src/runtime/proc.go:126 +0x36
runtime.systemstack(0x593600)
    /usr/lib/go/src/runtime/asm_amd64.s:298 +0x79
runtime.mstart()
    /usr/lib/go/src/runtime/proc.go:1079

goroutine 1 [running]:
runtime.systemstack_switch()
    /usr/lib/go/src/runtime/asm_amd64.s:252 fp=0xc42002a768 sp=0xc42002a760
runtime.main()
    /usr/lib/go/src/runtime/proc.go:127 +0x6c fp=0xc42002a7c0 sp=0xc42002a768
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42002a7c8 sp=0xc42002a7c0
Could not successfully bind to port 2181. Maybe some other service
in your system is using it? Please free the port and try again.
Exiting.
blesof commented 3 years ago

I have the same issue, also with Apple M1 chip. Did you maybe manage to fix it by yourself?

julianlecalvez commented 3 years ago

I have the same issue, also with Apple M1 chip. Did you maybe manage to fix it by yourself?

No, I didn't fix it. I'm still hoping an solution in this thread :)

blesof commented 3 years ago

No, I didn't fix it. I'm still hoping an solution in this thread :)

If you want a quick and dirty fix which works, you can comment this in setup-and-run.sh file (lines 500 to 504):

    elif ! /usr/local/bin/checkport -port "$port"; then
        echo "Could not successfully bind to port $port. Maybe some other service"
        echo "in your system is using it? Please free the port and try again."
        echo "Exiting."
        exit 1

And also remove duphard from Dockerfile. Then you can build this image locally and it works fine.

But still I'm waiting for a fix in this thread :) Issue is caused by checkport app used there.

ericnograles commented 3 years ago

Looking at the Dockerfile, looks like there's several things that need to be updated/ported to work for the M1's:

faberchri commented 3 years ago

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev
FilipeNavas commented 2 years ago

I was able to come up with an alternative, check it out here:

https://github.com/lensesio/fast-data-dev/issues/182#issuecomment-1018131875

medialwerk commented 2 years ago

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

Thank you very much! - It's working :-). I was thinking if it is possible to make a pull request here?

aminch18 commented 2 years ago

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I am having the same issue, I've tried to do this and it's not working.

As pictured below, you can see the error. Any idea?

image

M1 Pro Chip macOs monterey v.12.3.1 Thanks in advance :)

chanukyamoorthy commented 2 years ago

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

@faberchri , Thanks a lot the changes made in dockerFile worked

dougdonohoe commented 2 years ago

Created a fork with the required changes to run on arm64 / Apple M1.

Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I built on this to create PR 185 which adds support for arm64 and amd64 at same time + along with how to build a multi-arch image using docker buildx.

egel commented 2 years ago

Yes, this PR 185 from dougdonohoe help me a lot and solved the problem of compiling an image for linux/arm64 architecture.

Thank you, kind Sir! 🙌

henok-tesfa-kr commented 2 years ago

Created a fork with the required changes to run on arm64 / Apple M1. Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I am having the same issue, I've tried to do this and it's not working.

As pictured below, you can see the error. Any idea? image

M1 Pro Chip macOs monterey v.12.3.1 Thanks in advance :)

Hi I am facing the same issue, have you found a solution for this yet?

JBERKO9 commented 2 years ago

Created a fork with the required changes to run on arm64 / Apple M1. Execute the following sequence of commands:

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .
docker run --rm -p 3030:3030 faberchri/fast-data-dev

I am having the same issue, I've tried to do this and it's not working. As pictured below, you can see the error. Any idea? image M1 Pro Chip macOs monterey v.12.3.1 Thanks in advance :)

Hi I am facing the same issue, have you found a solution for this yet?

same here

dougdonohoe commented 2 years ago

I think this is because archive.lenses.io is down. It seems it has happened before, per this issue: https://github.com/lensesio/fast-data-dev/issues/186

dougdonohoe commented 2 years ago

You can also just docker pull dougdonohoe/fast-data-dev and get the image I built prior to the issues with archive.lenses.io

dougdonohoe commented 1 year ago

I filed a ticket with lenses.io over the weekend and they seem to have restored archive.lenses.io. It's working for me now.