Skip to content

Panic: : integer divide by zero when running in alpine container #89

@sanketsudake

Description

@sanketsudake

I am compiling kube-prompt and then running from container. Getting following error
as soon as prompt starts.

bash-5.1# kube-prompt 
kube-prompt  (rev-)
Please use `exit` or `Ctrl-D` to exit this program.
Bye!
panic: runtime error: integer divide by zero

goroutine 1 [running]:
github.com/c-bata/go-prompt.(*Render).toPos(...)
        /go/pkg/mod/github.com/c-bata/go-prompt@v0.2.5/render.go:269
github.com/c-bata/go-prompt.(*Render).move(0xc0001dfb18, 0x112521b, 0xc0001dfb18)
        /go/pkg/mod/github.com/c-bata/go-prompt@v0.2.5/render.go:258 +0xbb
github.com/c-bata/go-prompt.(*Render).clear(0xc0003bc5b0, 0x112521b)
        /go/pkg/mod/github.com/c-bata/go-prompt@v0.2.5/render.go:245 +0x25
github.com/c-bata/go-prompt.(*Render).BreakLine(0xc0003bc5b0, 0xc00032dbc0)
        /go/pkg/mod/github.com/c-bata/go-prompt@v0.2.5/render.go:229 +0x22d
github.com/c-bata/go-prompt.(*Prompt).feed(0xc00038b5f0, {0xc000127800, 0x0, 0x400})
        /go/pkg/mod/github.com/c-bata/go-prompt@v0.2.5/prompt.go:124 +0x31a
github.com/c-bata/go-prompt.(*Prompt).Run(0xc00038b5f0)
        /go/pkg/mod/github.com/c-bata/go-prompt@v0.2.5/prompt.go:71 +0x539
main.main()
        /app/kube-prompt/main.go:41 +0x37f

Dockerfile

FROM golang:1.18-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git
RUN git clone https://github.com/c-bata/kube-prompt.git
RUN cd kube-prompt && go build -o kube-prompt .

FROM alpine:3.15
COPY --from=builder /app/kube-prompt/kube-prompt .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions