Skip to content

Commit

Permalink
adds docker capabilities (#61)
Browse files Browse the repository at this point in the history
* adding docker capabilities

* clean up .docker/ and simplify docker build

* adding docker build to travis build

* adding Dockerfile.local for faster local development
  • Loading branch information
kcajmagic authored Nov 30, 2018
1 parent 6e25696 commit 6fa1bd4
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ after_success:
- docker cp build:/versionno.txt .
- BINARY_NAME=`ls x86_64/`
- TRAVIS_TAG=`cat versionno.txt`
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker build -t talaria:local .; fi'

deploy:
provider: releases
Expand Down
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:alpine as builder
MAINTAINER Jack Murdock <[email protected]>

# build the binary
WORKDIR /go/src
RUN apk add --update --repository https://dl-3.alpinelinux.org/alpine/edge/testing/ git curl
RUN curl https://glide.sh/get | sh
COPY src/ /go/src/

RUN glide -q install --strip-vendor
RUN go build -o talaria_linux_amd64 talaria

EXPOSE 6200 6201 6202
RUN mkdir -p /etc/talaria
VOLUME /etc/talaria

# the actual image
FROM alpine:latest
RUN apk --no-cache add ca-certificates
RUN mkdir -p /etc/talaria
VOLUME /etc/talaria
WORKDIR /root/
COPY --from=builder /go/src/talaria_linux_amd64 .
ENTRYPOINT ["./talaria_linux_amd64"]
21 changes: 21 additions & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM golang:alpine as builder
MAINTAINER Jack Murdock <[email protected]>

# build the binary
WORKDIR /go/src
COPY src/ /go/src/

RUN go build -o talaria_linux_amd64 talaria

EXPOSE 6200 6201 6202
RUN mkdir -p /etc/talaria
VOLUME /etc/talaria

# the actual image
FROM alpine:latest
RUN apk --no-cache add ca-certificates
RUN mkdir -p /etc/talaria
VOLUME /etc/talaria
WORKDIR /root/
COPY --from=builder /go/src/talaria_linux_amd64 .
ENTRYPOINT ["./talaria_linux_amd64"]
61 changes: 61 additions & 0 deletions example-talaria.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
fqdn: talaria
env: test
scheme: http

primary:
address: ":6200"
health:
address: ":6201"
pprof:
address: ":6202"
control:
address: ":6203"
metric:
address: ":6404"
metricsOptions:
namespace: "xmidt"
subsystem: "talaria"

log:
file: "stdout"
level: "DEBUG"
json: false

device:
manager:
upgrader:
handshakeTimeout: "10s"
initialCapacity: 100000
maxDevices: 100
deviceMessageQueueSize: 100
pingPeriod: "45s"
idlePeriod: "135s"
requestTimeout: "15s"
outbound:
method: "POST"
eventEndpoints:
default: http://caduceus:6000/api/v3/notify
requestTimeout: "125s"
defaultScheme: "https"
allowedSchemes:
- "http"
- "https"
outboundQueueSize: 1000
workerPoolSize: 100
transport:
maxIdleConns: 0
maxIdleConnsPerHost: 100
idleConnTimeout: "120s"
clientTimeout: "160s"
authKey: YXV0aEhlYWRlcg==
inbound:
authKey: YXV0aEhlYWRlcg==

eventMap:
default: http://caduceus:6000/api/v3/notify

service:
defaultScheme: http
fixed:
- http://talaria:6200

0 comments on commit 6fa1bd4

Please sign in to comment.