From 3d03d09f9beb1dd6facaed7669458ffa40ba2311 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Sun, 12 Mar 2017 23:49:51 +0000 Subject: [PATCH] Add support to build gianarb/orbiter docker image --- Dockerfile | 5 +++++ Makefile | 4 ++++ README.md | 12 ++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9962ba3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine + +ADD ./bin/orbiter /opt/orbiter + +CMD ["/opt/orbiter", "daemon", "-config", "/etc/orbiter.yml"] diff --git a/Makefile b/Makefile index 104f1bd..2185808 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,12 @@ binaries: @echo "Compiling..." @mkdir -p ./bin @go build -i -o ./bin/orbiter + @CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -i -o ./bin/orbiter @echo "All done! The binaries is in ./bin let's have fun!" +build/docker: binaries + @docker build -t gianarb/orbiter:latest . + vet: ## run go vet @test -z "$$(go vet ${PACKAGES} 2>&1 | grep -v '*composite literal uses unkeyed fields|exit status 0)' | tee /dev/stderr)" diff --git a/README.md b/README.md index 706f366..1681f10 100644 --- a/README.md +++ b/README.md @@ -106,3 +106,15 @@ func CreateAutoScaler() *autoscaler.Autoscaler{ return a } ``` + +## With docker + +```sh +docker run -it -v ${PWD}/your.yml:/etc/orbiter.yml -p 8000:8000 gianarb/orbiter +``` +We are supporting an imag `gianarb/orbiter` in hub.docker.com. You can run it +with your configuration. + +In this example I am using volumes but if you have a Docker Swarm 1.13 up and +running you can use secrets. +