Closed TylerSustare closed 2 years ago
I'm even getting this when running in a docker container
Terminal output
➜ docker run -p 8090:8090 pocket
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:8090 -> 0.0.0.0:0: listen tcp 0.0.0.0:8090: bind: address already in use.
ERRO[0000] error waiting for container: context canceled
Dockerfile
FROM golang:1.19
WORKDIR /usr/src/app
EXPOSE 8090
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -v -o /usr/local/bin/app ./...
CMD ["app", "serve"]
It looks like you're already using the port :8090
in another process.
Maybe a local webserver or another container?
You can check which process it is with lsof -i | grep ":8090"
:
pocketbas PROCESSID user ... TCP localhost:8090 (LISTEN)
Hey @a10d Thank you for taking a look, but I mentioned in the description I killed all processes running on :8090
, and running this in a docker container where there are definitely no other processes running on :8090
is still making this happen.
Running it with go run main.go serve --http "localhost:8080"
worked. So although nothing was running on :8090
, something with the default config must not be working the way I would have expected. If it's working for others though I can close this.
Sorry, I missed that.
I tried it on my machine with the dockerfile you provided and it also did not work, the connection was reset immediately.
When I changed it explicitly serve over http, it worked. CMD ["app", "serve", "--http=0.0.0.0:8090"]
Looks like its trying to serve over https (?)
I did not get the error from docker tho, and running it on my machine directly it also works.
Looking at you terminal output, the process seems to start like it should, but when mapping the port on your machine, the error from the docker daemon shows up.
Does it work on another port?
Whoops, I was too slow. 😄
tl;dr;
After following the setup instructions on the README, I'm not able to run pocketbase as a framework. It's the minimal amount of code to run the framework, but I keep getting an
address already in use
error when runninggo run main.go serve
. It seems that the server starts, but then gets this error, which seems strange.Env
I've tried
:8090
-buildmode=pie
after seeing https://github.com/golang/go/issues/55058Terminal output with debug
Code
main.go
go.mod