Merge branch 'master' into bdb__limit_pod_list_by_namespace

This commit is contained in:
Mikolaj Pawlikowski
2018-12-19 13:31:29 +00:00
committed by GitHub
5 changed files with 62 additions and 3 deletions
+9 -1
View File
@@ -1,7 +1,15 @@
language: go
services:
- docker
go:
- "1.10.x"
- master
script: go get -u github.com/golang/dep/cmd/dep && make vendor && make
script:
- docker --version
- go get -u github.com/golang/dep/cmd/dep && make vendor && make && make build
- docker images
- make build-multistage
- docker images
+27
View File
@@ -0,0 +1,27 @@
FROM golang:1.11-alpine as builder
# Install our build tools
RUN apk add --update git make bash
RUN go get -u github.com/golang/dep/cmd/dep
# Get sources
RUN go get github.com/bloomberg/goldpinger/cmd/goldpinger
WORKDIR /go/src/github.com/bloomberg/goldpinger
# Install our dependencies
RUN make vendor
# Build goldpinger
RUN make bin/goldpinger
# Build the asset container, copy over goldpinger
FROM scratch
COPY --from=builder /go/src/github.com/bloomberg/goldpinger/bin/goldpinger /goldpinger
COPY ./static /static
ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"]
+4 -1
View File
@@ -22,8 +22,11 @@ swagger:
swagger generate server -t pkg -f ./swagger.yml --exclude-main -A goldpinger && \
swagger generate client -t pkg -f ./swagger.yml -A goldpinger
build-multistage:
sudo docker build -t $(tag) -f ./Dockerfile .
build: bin/$(bin)
sudo docker build -t $(tag) -f ./build/Dockerfile .
sudo docker build -t $(tag) -f ./build/Dockerfile-simple .
tag:
sudo docker tag $(tag) $(namespace)$(tag)
+22 -1
View File
@@ -13,6 +13,8 @@ Oh, and it gives you the graph below for your cluster. Check out the [video expl
- [Rationale](#rationale)
- [Quick start](#quick-start)
- [Building](#building)
- [Compiling using a multi-stage Dockerfile](#compiling-using-a-multi-stage-dockerfile)
- [Compiling locally](#compiling-locally)
- [Installation](#installation)
- [Authentication with Kubernetes API](#authentication-with-kubernetes-api)
- [Example YAML](#example-yaml)
@@ -46,9 +48,28 @@ Note, that in order to guarantee correct versions of dependencies, the project [
## Building
The repo comes with two ways of building a `docker` image: compliling locally, and compliling using a multi-stage `Dockerfile` image.
### Compiling using a multi-stage Dockerfile
You will need `docker` version 17.05+ installed to support multi-stage builds.
```sh
# step 1: launch the build
make build-multistage
# step 2: push the image somewhere
namespace="docker.io/myhandle/" make tag
namespace="docker.io/myhandle/" make push
```
This was contributed via [@michiel](https://github.com/michiel) - kudos !
### Compiling locally
In order to build `Goldpinger`, you are going to need `go` version 1.10+, `dep`, and `docker`.
Building from source code consists of compiling the binary and building a [Docker image](./build/Dockerfile):
Building from source code consists of compiling the binary and building a [Docker image](./build/Dockerfile-simple):
```sh
# step 0: check out the code into your $GOPATH