Skip to content
Snippets Groups Projects
Dockerfile.debug 718 B
Newer Older
  • Learn to ignore specific revisions
  • Shrey Garg's avatar
    Shrey Garg committed
    
    
    FROM golang:$GOLANG_VERSION-buster as builder
    WORKDIR /gnmi-target/
    
    Shrey Garg's avatar
    Shrey Garg committed
    COPY . .
    
    RUN --mount=type=cache,target=/root/go/pkg/mod \
        --mount=type=cache,target=/root/.cache/go-build
    
    RUN go install github.com/go-delve/delve/cmd/dlv@v1.22.1
    
    FROM ubuntu:24.04 as ubuntu
    
    EXPOSE 7030
    WORKDIR /debug/
    RUN apt-get update && apt-get upgrade -y
    RUN apt-get install -y iproute2
    RUN apt-get install -y iputils-ping
    COPY --from=builder /go/bin/dlv /debug/
    COPY --from=builder /gnmi-target/artifacts/gnmi-target /debug/
    CMD [ "/debug/dlv", "--listen=:4000", "--headless=true", "--log=true", "--accept-multiclient", "--api-version=2", "exec", "/debug/gnmi-target", "start" ]