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

docker logs -f does not show progress bar #150

Open
Marijus opened this issue Dec 6, 2022 · 1 comment
Open

docker logs -f does not show progress bar #150

Marijus opened this issue Dec 6, 2022 · 1 comment

Comments

@Marijus
Copy link

Marijus commented Dec 6, 2022

When trying to follow docker container logs with "docker logs container -f" the progress bar is not showing even though by default it's following StdOut and the progress bar is writing to os.Stdout

main.go

package main

import (
	"time"

	"github.com/schollz/progressbar/v3"
)

func main() {
	bar := progressbar.Default(100)

	for i := 0; i < 100; i++ {
		bar.Add(1)
		time.Sleep(1 * time.Second)
	}
}

Dockerfile

FROM golang:1.18-alpine
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -o /application
CMD [ "/application" ]

Building:

docker build -t app .
Running:

docker run -d -t app
Follow logs:

docker logs 0b26e53d7321 -f

@oldwang12
Copy link

same with you.

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

No branches or pull requests

2 participants