forked from chr-fritz/csi-sshfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.debug
23 lines (17 loc) · 935 Bytes
/
Dockerfile.debug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM golang:1.12-alpine3.9 AS build-env
RUN apk add --no-cache git && \
go get github.com/derekparker/delve/cmd/dlv
ENV CGO_ENABLED=0, GO111MODULE=on
WORKDIR /go/src/github.com/chr-fritz/csi-sshfs
ADD . /go/src/github.com/chr-fritz/csi-sshfs
RUN go mod download
RUN export BUILD_TIME=`date -R` && \
export VERSION=`cat /go/src/github.com/chr-fritz/csi-sshfs/version.txt 2&> /dev/null`
RUN go build -o /csi-sshfs -ldflags "-X 'github.com/chr-fritz/csi-sshfs/pkg/sshfs.BuildTime=${BUILD_TIME}' -X 'github.com/chr-fritz/csi-sshfs/pkg/sshfs.Version=${VERSION}'" -gcflags "all=-N -l" github.com/chr-fritz/csi-sshfs/cmd/csi-sshfs
FROM alpine:3.9
EXPOSE 40000
RUN apk add --no-cache ca-certificates sshfs findmnt libc6-compat
COPY --from=build-env /csi-sshfs /bin/csi-sshfs
COPY --from=build-env /go/bin/dlv /
ENTRYPOINT ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/bin/csi-sshfs", "--"]
CMD [""]