Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from nats-io/goreleaser_docker
Browse files Browse the repository at this point in the history
use goreleaser to build the docker image
  • Loading branch information
ripienaar authored Dec 18, 2019
2 parents dfb6282 + 10b5558 commit 3aac169
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
12 changes: 11 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,23 @@ builds:
goarch: 386

archives:
- name_template: "{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}"
- name_template: "{{.ProjectName}}-{{.Version}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}"
wrap_in_directory: true
format: zip
files:
- README.md
- LICENSE

dockers:
- goos: linux
goarch: amd64
skip_push: true
binaries:
- jsm
image_templates:
- "synadia/jsm:latest"
- "synadia/jsm:{{.Version}}"

checksum:
name_template: "SHA256SUMS"
algorithm: sha256
22 changes: 5 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
FROM golang:1.13.4-alpine3.10 AS builder

WORKDIR $GOPATH/src/github.com/nats-io/jetstream

RUN apk add -U --no-cache git binutils

WORKDIR $GOPATH/src/github.com/nats-io/jetstream

COPY . .

RUN go install ./...
RUN strip /go/bin/*

FROM synadia/nats-box:latest

RUN apk add --update ca-certificates

COPY --from=builder /go/bin/* /usr/local/bin/
# goreleaser does the build
COPY jsm /usr/local/bin/

ENTRYPOINT ["/bin/sh", "-l"]
RUN apk add --update ca-certificates man && \
mkdir -p /usr/share/man/man1 && \
jsm --help-man > /usr/share/man/man1/jsm.1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ While this is an incomplete architecture it does show a number of key points:
* Observables can have different modes of operation and receive just subsets of the messages
* Multiple Acknowledgement modes are supported

A new order arrives on `ORDERS.received`, gets sent to the `NEW` Observable who, on success, will create a new message on `ORDERS.processed`. The `ORDERS.processed` message again enters the store where a `DISPATCH` Observable receives it and once processed it will create a `ORDERS.completed` message which will again enter the Message Set. These operations are all `push` based meaning they are work queues and can scale horizontally. All require acknowledged delivery ensuring no order is missed.
A new order arrives on `ORDERS.received`, gets sent to the `NEW` Observable who, on success, will create a new message on `ORDERS.processed`. The `ORDERS.processed` message again enters the store where a `DISPATCH` Observable receives it and once processed it will create a `ORDERS.completed` message which will again enter the Message Set. These operations are all `pull` based meaning they are work queues and can scale horizontally. All require acknowledged delivery ensuring no order is missed.

All messages are delivered to a `MONITOR` Observable without any acknowledgement and using Pub/Sub semantics - they are pushed to the monitor.

Expand Down
2 changes: 2 additions & 0 deletions jsm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ var (
tlsKey string
tlsCA string
timeout time.Duration
version string
)

func main() {
jsm := kingpin.New("jsm", "JetStream Management Utility")
jsm.Author("NATS Authors <[email protected]>")
jsm.Version(version)

jsm.HelpFlag.Short('h')

Expand Down

0 comments on commit 3aac169

Please sign in to comment.