aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index 98d79c0..9a8619e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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
Un proyecto texto-plano.xyz