Skip to content

Commit

Permalink
Merge pull request #29 from kcajmagic/dockerize
Browse files Browse the repository at this point in the history
adds docker capabilities
  • Loading branch information
kcajmagic committed Nov 30, 2018
2 parents 106d933 + f3206c9 commit a9d7fcb
Show file tree
Hide file tree
Showing 4 changed files with 78 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 petasos: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 <jack_murdock@comcast.com>

# 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 petasos_linux_amd64 petasos

EXPOSE 6400 6401 6402 6403
RUN mkdir -p /etc/petasos
VOLUME /etc/petasos

# the actual image
FROM alpine:latest
RUN apk --no-cache add ca-certificates
RUN mkdir -p /etc/petasos
VOLUME /etc/petasos
WORKDIR /root/
COPY --from=builder /go/src/petasos_linux_amd64 .
ENTRYPOINT ["./petasos_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 <jack_murdock@comcast.com>

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

RUN go build -o petasos_linux_amd64 petasos

EXPOSE 6400 6401 6402 6403
RUN mkdir -p /etc/petasos
VOLUME /etc/petasos

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

primary:
address: ":6400"
health:
address: ":6401"
options:
- "PayloadsOverZero"
- "PayloadsOverHundred"
- "PayloadsOverThousand"
- "PayloadsOverTenThousand"
pprof:
address: ":6402"
metric:
address: ":6403"
metricsOptions:
namespace: "xmidt"
subsystem: "petasos"

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


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

0 comments on commit a9d7fcb

Please sign in to comment.