diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5511a78 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:latest as builder + +WORKDIR /boa +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN go build -o ./boa ./cmd/boa + +FROM golang:latest +LABEL maintainer="Dominik Roos " + +ARG WORKDIR=/workdir +RUN mkdir -p ${WORKDIR} +WORKDIR /workdir +COPY --from=builder /boa/boa /usr/local/bin + +ENTRYPOINT ["boa"] diff --git a/README.md b/README.md index 11c6b81..b6f4bd1 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,18 @@ A venom-free generator for cobra applications. go get -u github.com/oncilla/boa/cmd/boa ``` +## Docker + +If you prefer using docker instead: + +```txt +WORKDIR=$(pwd)/path/to/application +docker run \ + -v $WORKDIR/:/workdir \ + --user "$(id -u):$(id -g)" \ + docker.pkg.github.com/oncilla/boa/boa:latest +``` + ## Getting started `boa` proposes a different layout than what `cobra` proposes as a [typical