Skip to content

Commit

Permalink
Dockerization
Browse files Browse the repository at this point in the history
  • Loading branch information
RaJiska committed Dec 23, 2020
1 parent 65993f1 commit 340f232
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.14-alpine AS builder

RUN \
apk add --no-cache git
COPY . /go/src/github.com/mihirsoni/odfe-monitor-cli
WORKDIR /go/src/github.com/mihirsoni/odfe-monitor-cli
ARG COMMIT=v0.2.0
RUN \
git checkout -f $COMMIT && \
go get -v && \
go build -v

FROM alpine:latest

COPY --from=builder /go/src/github.com/mihirsoni/odfe-monitor-cli/odfe-monitor-cli /usr/local/bin
WORKDIR /odfe-monitor-cli

ENTRYPOINT [ "odfe-monitor-cli" ]
8 changes: 8 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ From binary to `/usr/local/bin/odfe-monitor-cli`:
$ curl -sfL https://raw.githubusercontent.com/mihirsoni/odfe-monitor-cli/master/godownloader.sh | bash -s -- -b /usr/local/bin
```

From Docker:
```
$ git clone https://github.com/mihirsoni/odfe-monitor-cli/
$ cd odfe-monitor-cli
$ docker build -t odfe-monitor-cli . # Add "--build-arg COMMIT=master" to build a specific version, replace `master` with the desired commit / tag
$ docker run --rm -v $(pwd):/odfe-monitor-cli odfe-monitor-cli sync -u <user> -p <password> -e <host> --monitors
```

## Getting Started


Expand Down

0 comments on commit 340f232

Please sign in to comment.