diff --git a/Dockerfile b/Dockerfile index 24ebafa6..e9c65388 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,17 @@ -FROM scratch -COPY wtfutil / -ENTRYPOINT ["/wtfutil"] +FROM golang:1.13-alpine + +RUN apk add --no-cache make ncurses + +COPY . $GOPATH/src/github.com/wtfutil/wtf + +ENV GOPROXY=https://gocenter.io +ENV GO111MODULE=on +ENV GOSUMDB=off + +WORKDIR $GOPATH/src/github.com/wtfutil/wtf + +ENV PATH=$PATH:./bin + +RUN make build + +ENTRYPOINT "wtfutil" diff --git a/README.md b/README.md index 6ce24efa..e305928a 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,21 @@ make run **Note:** WTF is _only_ compatible with Go versions **1.12.0** or later (due to the use of Go modules and newer standard library functions). If you would like to use `gccgo` to compile, you _must_ use `gccgo-9` or later which introduces support for Go modules. +## Install and run in Docker + +You can run `wtf` inside a docker container + +```bash +# download the source +git clone https://github.com/wtfutil/wtf + +# build the docker container +docker build -t wtfutil . + +# run the container +docker run -it wtfutil +``` + ## Communication ### Slack