diff --git a/.dockerignore b/.dockerignore index 38af8d6..2d2ecd6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1 @@ .git/ -/vendor/ diff --git a/.travis.yml b/.travis.yml index e5cbde6..f9fc269 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,11 @@ script: - docker images - docker run `make version` --help + # build an image with the vendor folder + - make clean && make vendor && make vendor-build + - docker images + - docker run `make version`-vendor --help + deploy: provider: script script: bash docker_deploy.sh diff --git a/Dockerfile b/Dockerfile index ad64b84..192961c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,4 @@ RUN make bin/goldpinger FROM scratch COPY --from=builder /go/src/github.com/bloomberg/goldpinger/bin/goldpinger /goldpinger COPY ./static /static -ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"] - +ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"] \ No newline at end of file diff --git a/Makefile b/Makefile index e60c60e..49ccfec 100644 --- a/Makefile +++ b/Makefile @@ -42,4 +42,15 @@ run: version: @echo $(tag) -.PHONY: clean vendor swagger build build-multistage tag push run version + +vendor-build: + docker build -t $(tag)-vendor --build-arg TAG=$(tag) -f ./build/Dockerfile-vendor . + +vendor-tag: + docker tag $(tag)-vendor $(namespace)$(tag)-vendor + +vendor-push: + docker push $(namespace)$(tag)-vendor + + +.PHONY: clean vendor swagger build build-multistage vendor-build vendor-tag vendor-push tag push run version diff --git a/README.md b/README.md index e1cba9a..589cf86 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,20 @@ If you'd like to know more, you can watch [our presentation at Kubecon 2018 Seat ## Quick start +Getting from sources: + ```sh go get github.com/bloomberg/goldpinger/cmd/goldpinger goldpinger --help ``` +Getting from [docker hub](https://hub.docker.com/r/bloomberg/goldpinger): + +```sh +# get from docker hub +docker pull bloomberg/goldpinger +``` + Note, that in order to guarantee correct versions of dependencies, the project [uses `dep`](./Makefile). @@ -105,8 +114,6 @@ namespace="docker.io/myhandle/" make push Here's an example of what you can do (using the in-cluster authentication to `Kubernetes` apiserver). -:warning: Replace `docker.io/mynamespace-replaceme/goldpinger:1.0.0` with the actual tag you built. - ```yaml --- apiVersion: apps/v1 @@ -143,7 +150,7 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - image: "docker.io/mynamespace-replaceme/goldpinger:1.0.0" + image: "docker.io/bloomberg/goldpinger:1.4.0" ports: - containerPort: 80 name: http @@ -252,3 +259,5 @@ Before you create that PR, please make sure you read [CONTRIBUTING](./CONTRIBUTI ## License Please read the [LICENSE](./LICENSE) file here. + +For each version built by travis, there is also an additional version, appended with `-vendor`, which contains all source code of the dependencies used in `goldpinger`. diff --git a/build/Dockerfile-simple b/build/Dockerfile-simple index f3a9ae5..3c6807a 100644 --- a/build/Dockerfile-simple +++ b/build/Dockerfile-simple @@ -1,6 +1,6 @@ FROM scratch -ADD bin/goldpinger /goldpinger -COPY ./static /static +COPY bin/goldpinger /goldpinger +COPY static /static ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"] diff --git a/build/Dockerfile-vendor b/build/Dockerfile-vendor new file mode 100644 index 0000000..cde12a1 --- /dev/null +++ b/build/Dockerfile-vendor @@ -0,0 +1,3 @@ +ARG TAG +FROM $TAG +COPY vendor /goldpinger-vendor-sources diff --git a/docker_deploy.sh b/docker_deploy.sh index b3987dd..b1a33b9 100755 --- a/docker_deploy.sh +++ b/docker_deploy.sh @@ -1,4 +1,8 @@ #!/bin/sh -docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD" && make tag && make push +docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD" \ + && make tag \ + && make push \ + && make vendor-tag \ + && make vendor-push diff --git a/extras/example-serviceaccounts.yml b/extras/example-serviceaccounts.yml index cc10988..7ff2bb2 100644 --- a/extras/example-serviceaccounts.yml +++ b/extras/example-serviceaccounts.yml @@ -42,7 +42,7 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - image: "docker.io/mynamespace-replaceme/goldpinger:1.1.0" + image: "docker.io/bloomberg/goldpinger:1.4.0" ports: - containerPort: 80 name: http diff --git a/extras/example-with-kubeconfig.yaml b/extras/example-with-kubeconfig.yaml index 8038605..49812ab 100644 --- a/extras/example-with-kubeconfig.yaml +++ b/extras/example-with-kubeconfig.yaml @@ -48,7 +48,7 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - image: "docker.io/mynamespace-replaceme/goldpinger:1.1.0" + image: "docker.io/bloomberg/goldpinger:1.4.0" ports: - containerPort: 80 name: http