forked from veepee-oss/influxdb-relay
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated docker image building system ,cleaned unused files
- Loading branch information
Toni Moreno Gimenez
committed
May 10, 2020
1 parent
32bcd8d
commit 070d263
Showing
16 changed files
with
81 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[run] | ||
init_cmds = [ | ||
["scripts/build.py","--clean","-v","--race"], | ||
["go", "build", "-race","-o", "./build/influxdb-srelay", "."], | ||
["./build/influxdb-srelay", "-config", "./examples/influxdb-srelay.conf", "-logdir","./logs"] | ||
] | ||
watch_all = true | ||
watch_dirs = [ | ||
"$WORKDIR", | ||
] | ||
watch_exts = [".go", ".toml"] | ||
watch_exts = [".go", ".conf"] | ||
build_delay = 1500 | ||
cmds = [ | ||
["scripts/build.py","--clean","-v","--race"], | ||
["go", "build", "-race","-o", "./bin/syncflux", "./pkg/"], | ||
["./build/influxdb-srelay","-config","./examples/influxdb-srelay.conf","-logdir","./logs"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ dist/* | |
pkg | ||
pkg/* | ||
.vscode/ | ||
logs/* | ||
dev/* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,34 @@ | ||
# The MIT License (MIT) | ||
# | ||
# Copyright (c) 2018 Vente-Privée | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
FROM golang:alpine AS build-env | ||
|
||
# Add missing git | ||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add git | ||
|
||
# Install | ||
RUN go get -u github.com/toni-moreno/influxdb-srelay && \ | ||
mv /go/bin/influxdb-srelay /usr/bin/influxdb-srelay && \ | ||
chmod 755 /usr/bin/influxdb-srelay && \ | ||
mkdir /etc/influxdb-srelay && \ | ||
touch /etc/influxdb-srelay/influxdb-srelay.conf | ||
FROM golang:1.13.4-alpine as builder | ||
|
||
RUN apk add --no-cache gcc g++ bash git | ||
|
||
WORKDIR $GOPATH/src/github.com/toni-moreno/influxdb-srelay | ||
|
||
COPY go.mod go.sum ./ | ||
COPY backend/ ./backend/ | ||
COPY cluster/ ./cluster/ | ||
COPY config/ ./config/ | ||
COPY prometheus/ ./prometheus/ | ||
COPY relay/ ./relay/ | ||
COPY relayctx/ ./relayctx/ | ||
COPY relayservice/ ./relayservice/ | ||
COPY utils/ ./utils/ | ||
COPY main.go ./ | ||
COPY .git .git | ||
COPY build.go ./ | ||
|
||
#COPY . ./ | ||
RUN ls -lisa ./ | ||
RUN go run build.go build | ||
|
||
FROM alpine:latest | ||
|
||
COPY --from=build-env /usr/bin/influxdb-srelay / | ||
COPY --from=build-env /go/src/github.com/toni-moreno/influxdb-srelay/example/sample.influxdb-srelay.conf /etc/influxdb-srelay/ | ||
COPY --from=builder /go/src/github.com/toni-moreno/influxdb-srelay/bin/influxdb-srelay ./bin/ | ||
COPY ./examples/*.conf /etc/influxdb-srelay/ | ||
COPY ./examples/sample.influxdb-srelay.conf /etc/influxdb-srelay/influxdb-srelay.conf | ||
RUN mkdir -p /var/log/influxdb-srelay | ||
|
||
ENTRYPOINT [ "/usr/bin/influxdb-srelay" ] | ||
ENTRYPOINT [ "/bin/influxdb-srelay" ] | ||
|
||
CMD [ "-config", "/etc/influxdb-srelay/influxdb-srelay.conf" , "-logdir","/var/log/influxdb-srelay" ] | ||
CMD [ "-config", "/etc/influxdb-srelay/influxdb-srelay.conf" , "-logs","/var/log/influxdb-srelay" ] | ||
# EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
REPO_VERSION=$(shell git describe --abbrev=0 --tag) | ||
IMAGE_VERSION=$(REPO_VERSION) | ||
DOCKER_FILE?=./ | ||
NETWORK_NAME?=host | ||
REGISTRY=tonimoreno | ||
DATE=$(shell date +%Y%m%d%H%M%S ) | ||
|
||
.PHONY: all clean-image clean build-image build push force-build-image force-build run | ||
|
||
all: build | ||
|
||
clean-image: | ||
docker rmi $(REGISTRY)/influxdb-srelay:$(REPO_VERSION) | ||
|
||
clean: clean-image | ||
|
||
|
||
build-image: | ||
docker build -t $(REGISTRY)/influxdb-srelay:$(IMAGE_VERSION) $(DOCKER_FILE) | ||
docker build -t $(REGISTRY)/influxdb-srelay:latest $(DOCKER_FILE) | ||
|
||
build: build-image | ||
|
||
push: | ||
docker push $(REGISTRY)/influxdb-srelay:$(IMAGE_VERSION) | ||
docker push $(REGISTRY)/influxdb-srelay:latest | ||
|
||
force-build-image: | ||
docker rmi -f $(REGISTRY)/influxdb-srelay:$(IMAGE_VERSION) | ||
docker rmi -f $(REGISTRY)/influxdb-srelay:latest | ||
docker build --no-cache -t $(REGISTRY)/influxdb-srelay:$(IMAGE_VERSION) $(DOCKER_FILE) | ||
docker build --no-cache -t $(REGISTRY)/influxdb-srelay:latest $(DOCKER_FILE) | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,41 +37,30 @@ Other versions will probably work but are untested. | |
|
||
## Setup | ||
|
||
### Go | ||
### From Sources | ||
|
||
Download the daemon into your `$GOPATH` and install it in `/usr/sbin`. | ||
|
||
```sh | ||
go get -u github.com/toni-moreno/influxdb-srelay | ||
cp ${GOPATH}/bin/influxdb-srelay /usr/bin/influxdb-srelay | ||
chmod 755 /usr/bin/influxdb-srelay | ||
git clone https://github.com/toni-moreno/influxdb-srelay | ||
cd influxdb-srelay | ||
go run build.go build | ||
./bin/influxdb-srelay -config ./examples/sample.influxdb-srelay.conf -logs ./log | ||
``` | ||
|
||
Create the configuration file in `/etc/influxdb-srelay`. | ||
|
||
```sh | ||
mkdir -p /etc/influxdb-srelay | ||
mkdir -p /var/log/influxdb-srelay | ||
cp ${GOPATH}/src/github.com/toni-moreno/influxdb-srelay/examples/sample.influxdb-srelay.conf \ | ||
/etc/influxdb-srelay/influxdb-srelay.conf | ||
``` | ||
|
||
### Docker | ||
|
||
Build your own image need for docker-ce > 17.05 ( or equivalent ee version ) | ||
|
||
```sh | ||
git clone git@github.com:toni-moreno/influxdb-srelay | ||
git clone https://github.com/toni-moreno/influxdb-srelay | ||
cd influxdb-srelay | ||
docker build \ | ||
--file Dockerfile \ | ||
--rm \ | ||
--tag influxdb-srelay:latest \ | ||
. | ||
make -f Makefile.docker | ||
|
||
docker run \ | ||
--volume /path/to/influxdb-srelay.conf:/etc/influxdb-srelay/influxdb-srelay.conf | ||
--rm | ||
influxdb-srelay:latest | ||
tonimoreno/influxdb-srelay:latest | ||
``` | ||
|
||
or | ||
|
@@ -264,11 +253,6 @@ This endpoint provides a quick way to get InfluxCluster Backends Data and statis | |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
## Limitations | ||
|
||
So far,this is compatible with Debian, RedHat, and other derivatives. | ||
|
@@ -278,25 +262,13 @@ So far,this is compatible with Debian, RedHat, and other derivatives. | |
Please read carefully [CONTRIBUTING.md][contribute-href] before making a merge | ||
request. | ||
|
||
Clone repository into your `$GOPATH`. | ||
|
||
```sh | ||
mkdir -p ${GOPATH}/src/github.com/toni-moreno | ||
cd ${GOPATH}/src/github.com/toni-moreno | ||
git clone [email protected]:toni-moreno/influxdb-srelay | ||
``` | ||
|
||
Enter the directory and build the daemon. | ||
|
||
```sh | ||
cd ${GOPATH}/src/github.com/toni-moreno/influxdb-srelay | ||
go build -a -ldflags '-extldflags "-static"' -o influxdb-srelay | ||
go run build.go build | ||
``` | ||
|
||
## Miscellaneous | ||
|
||
|
||
[license-img]: https://img.shields.io/badge/license-MIT-blue.svg | ||
[license-href]: LICENSE | ||
[overview-href]: https://github.com/influxdata/influxdb-relay | ||
[contribute-href]: CONTRIBUTING.md |
Oops, something went wrong.