aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAli Yousuf <aly.yousuf7@gmail.com>2018-01-03 03:57:30 +0500
committerGitHub <noreply@github.com>2018-01-03 03:57:30 +0500
commit0b973cda829597575adf5bd139ea374137b00526 (patch)
tree403a28d3077b65f89c5f64f7b624aee02a1d9992
parentbb2e5e71ae17adb1c04d5dc077f1525c8622ec17 (diff)
parent1f2fd1b48e4c11ab7f4c3cd5bd369c23bf56d112 (diff)
downloadsshtron-0b973cda829597575adf5bd139ea374137b00526.tar.gz
Merge pull request #23 from jaymoulin/builder
Docker with builder - reduce image size
-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