Added a Dockerfile to build the tool in a docker container

Use an alpine base image. The image size is 40MB.
This commit is contained in:
Valentin Mihov
2020-05-15 16:41:16 +03:00
parent b3bbeea3fb
commit 0c8029c950
2 changed files with 47 additions and 0 deletions

24
.dockerignore Normal file
View File

@@ -0,0 +1,24 @@
# Binaries for programs and plugins
*.exe
*.dll
*.so
*.dylib
ethdo
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
coverage.html
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
# Vim
*.sw?
# Local TODO
TODO.md
Dockerfile

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM golang:1.14.2-alpine3.11 as builder
RUN apk add build-base
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build
FROM alpine:3.11
RUN apk add libstdc++
WORKDIR /app
COPY --from=builder /app/ethdo /app
ENTRYPOINT ["/app/ethdo"]