diff options
-rw-r--r-- | Dockerfile | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,11 +1,12 @@ -FROM golang:latest +FROM golang:latest as builder WORKDIR $GOPATH/src/github.com/zachlatta/sshtron - -RUN apt-get update && apt-get install openssh-client && \ - ssh-keygen -t rsa -N "" -f id_rsa - ADD . . -RUN go get && go install +RUN go get && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /usr/bin/sshtron . +FROM alpine:latest + +COPY --from=builder /usr/bin/sshtron /usr/bin/ +RUN apk add --update --no-cache openssh-client && \ + ssh-keygen -t rsa -N "" -f id_rsa ENTRYPOINT sshtron |