Skip to content

Instantly share code, notes, and snippets.

@paddycarver
Created July 11, 2014 10:20
Show Gist options
  • Save paddycarver/4ced4d753737fbb98f91 to your computer and use it in GitHub Desktop.
Save paddycarver/4ced4d753737fbb98f91 to your computer and use it in GitHub Desktop.
Dockerfiles for NSQ images.
FROM google/golang
RUN go get github.com/tools/godep
RUN go get github.com/bmizerany/assert
ADD . /gopath/src/github.com/bitly/nsq
RUN godep get github.com/bitly/nsq/...
RUN cd /gopath/src/github.com/bitly/nsq && godep restore
FROM bitly/nsq
RUN cd /gopath/src/github.com/bitly/nsq/nsqadmin && godep go build .
EXPOSE 4171
ENTRYPOINT ["/gopath/src/github.com/bitly/nsq/nsqadmin/nsqadmin"]
FROM bitly/nsq
RUN cd /gopath/src/github.com/bitly/nsq/apps/nsqd && godep go build .
VOLUME ["/data"]
EXPOSE 4150
EXPOSE 4151
ENTRYPOINT ["/gopath/src/github.com/bitly/nsq/apps/nsqd/nsqd", "--data-path=/data"]
FROM bitly/nsq
RUN cd /gopath/src/github.com/bitly/nsq/apps/nsqlookupd && godep go build .
EXPOSE 4160
EXPOSE 4161
ENTRYPOINT ["/gopath/src/github.com/bitly/nsq/apps/nsqlookupd/nsqlookupd"]
@paddycarver
Copy link
Author

To build:

  • Dockerfile gets put in the root of the nsq repo
  • nsqadmin-Dockerfile gets put in the nsqadmin folder
  • nsqd-Dockerfile gets put in the apps/nsqd folder
  • nsqlookupd-Dockerfile gets put in the apps/nsqlookupd folder
  • run docker build -t bitly/nsq . in the root of the repo
  • run docker build -t bitly/nsqd . in the apps/nsqd folder
  • run docker build -t bitly/nsqlookupd . in the apps/nsqlookupd folder
  • run docker build -t bitly/nsqadmin . in the nsqadmin folder

To run:

  • nsqd: docker run --name nsqd -p 4150:4150 -p 4151:4151 bitly/nsqd -broadcast-address="172.17.42.1"
  • nsqlookupd: docker run --name nsqlookupd -p 4160:4160 -p 4161:4161 bitly/nsqlookupd -broadcast-address="172.17.42.1"
  • nsqadmin: docker run --name nsqadmin -p 4171:4171 bitly/nsqadmin --lookupd-http-address="172.17.42.1:4161"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment