Skip to content

Commit f0f58af

Browse files
committed
Add Dockerfile.debug
1 parent a06957e commit f0f58af

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Dockerfile.debug

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM golang as builder
2+
3+
# Build Delve debugger
4+
RUN go get github.com/go-delve/delve/cmd/dlv
5+
6+
# Build shass in debug mode
7+
WORKDIR $GOPATH/src/github.com/heroku/shaas
8+
ADD . $GOPATH/src/github.com/heroku/shaas
9+
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
10+
RUN go install -gcflags="all=-N -l"
11+
12+
FROM ubuntu
13+
14+
RUN apt-get update && apt-get install -y bash && apt-get install -y curl
15+
RUN groupadd -g 1000 app
16+
RUN useradd -s /bin/bash -u 1000 -g 1000 -d /app app
17+
RUN mkdir -p /app && chown app:app /app
18+
19+
USER app
20+
WORKDIR /app
21+
22+
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
23+
COPY --from=builder /go/bin/dlv .
24+
COPY --from=builder /go/bin/shaas .
25+
COPY --from=builder /go/src/github.com/heroku/shaas/bin/pseudo-interactive-bash /app/bin/pseudo-interactive-bash
26+
27+
EXPOSE 40000 # delve
28+
EXPOSE 5000 # shaas
29+
30+
# Start delve, which starts shaas after remote debugger connects
31+
CMD ["/app/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "/app/shaas"]

0 commit comments

Comments
 (0)