-
-
Notifications
You must be signed in to change notification settings - Fork 837
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
docs: Air **requires** tty, a detail that may be more important for Docker users #737
Comments
This note is probably missing in the README. I cant use the air docker image if it isnt open source (I cant find the source). Reading its source code might have saved me this. First problem
Solution
|
At this point from what I can tell, air runs successfully if I run it manually inside the container but not when docker runs it via |
Working: docker build -t app .
docker run -it --rm -p 3000:3000 -v .:/usr/src/app app go tool air Not working: FROM golang:1.24rc2-bookworm
WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -v -o /usr/local/bin/app ./...
CMD ["app"] services:
app:
build: .
ports:
- 3000:3000
volumes:
- .:/usr/src/app
command: bash -c 'go tool air' See https://docs.docker.com/reference/compose-file/services/#command
polling doesnt help |
SolutionBefore opening an issue on Docker Compose I wanted to make sure the two ( Air requires tty. When using Docker run I do this by default ( services:
app:
build: .
+ tty: true
ports:
- 3000:3000
volumes:
- .:/usr/src/app
command: go tool air If Is there a setting you can use to turn off the need for tty? Why is tty needed? |
Given that I just spent about 8h on this, a PR would be no big deal |
Description
Air runs my program, but does not live reload, when using Docker. It works on the host machine.
As a... for now... WSL developer, I really tried to get it working however I could.
Here's what I've tried:
Host machines
-> does not appear to be a host issue (WSL/Windows/Docker Desktop)
Docker configurations
docker run
docker compose up
docker run
docker compose up
-> does not appear to be either a bind mount or docker compose issue
Go versions
go install air
+air -c .air.toml
)go get -tool air
+go tool air -c .air.toml
)-> does not appear to be incompatibility with the upcoming
go get -tool
+go tool
or other unstable release bugAir versions
-> does not appear to be a regression in Air
Enabling
poll = true
-> I mean it doesn't seem like a fsnotify bug... because of all of the above, and because this isn't working for me either...
Reproduction
https://github.com/aentwist/air-repro
Environment / Preferred Environment
The text was updated successfully, but these errors were encountered: