Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 23638b5

Browse files
authored
Merge pull request #1627 from grafana/mt-gateway-docker-image
Add standalone Docker image for mt-gateway
2 parents 53949f8 + e256af1 commit 23638b5

File tree

6 files changed

+40
-2
lines changed

6 files changed

+40
-2
lines changed

.circleci/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- run: mkdir build_docker
1313
- run: docker save -o build_docker/metrictank.tar grafana/metrictank
1414
- run: docker save -o build_docker/metrictank-gcr.tar us.gcr.io/metrictank-gcr/metrictank
15+
- run: docker save -o build_docker/mt-gateway.tar grafana/mt-gateway
1516
- persist_to_workspace:
1617
root: .
1718
paths:
@@ -45,6 +46,7 @@ jobs:
4546
working_directory: /home/circleci/.go_workspace/src/github.com/grafana/metrictank
4647
machine:
4748
image: ubuntu-1604:201903-01
49+
resource_class: large
4850
steps:
4951
- checkout
5052
- attach_workspace:
@@ -76,6 +78,7 @@ jobs:
7678
docker login -u $DOCKER_USER -p $DOCKER_PASS
7779
docker load -i build_docker/metrictank.tar
7880
docker load -i build_docker/metrictank-gcr.tar
81+
docker load -i build_docker/mt-gateway.tar
7982
scripts/push/dockerhub.sh
8083
scripts/push/gcr.sh
8184
fi

cmd/mt-gateway/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
var (
1414
version = "(none)"
1515
showVersion = flag.Bool("version", false, "print version string")
16+
addr = flag.String("addr", ":6059", "http service address")
1617
metrictankUrl = flag.String("metrictank-url", "http://localhost:6060", "metrictank address")
1718
graphiteURL = flag.String("graphite-url", "http://localhost:8080", "graphite-api address")
1819
importerURL = flag.String("importer-url", "", "mt-whisper-importer-writer address")
19-
addr = flag.String("addr", ":80", "http service address")
2020
defaultOrgId = flag.Int("default-org-id", -1, "default org ID to send to downstream services if none is provided")
2121
brokers = flag.String("kafka-tcp-addr", "localhost:9092", "kafka tcp address(es) for metrics, in csv host[:port] format")
2222
)

docs/tools.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Usage:
5656
5757
Flags:
5858
-addr string
59-
http service address (default ":80")
59+
http service address (default ":6059")
6060
-default-org-id int
6161
default org ID to send to downstream services if none is provided (default -1)
6262
-discard-prefixes string

scripts/Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#############################
2+
# unpublished builder image #
3+
#############################
14
FROM golang:1.11.4-alpine AS gobase
25
RUN apk add --no-cache git bash
36

@@ -8,7 +11,22 @@ ADD . $MT_SRC_DIR
811
RUN $MT_SRC_DIR/scripts/build.sh
912
RUN cp -r $MT_SRC_DIR/build /tmp/build
1013

14+
####################
15+
# mt-gateway image #
16+
####################
17+
FROM alpine:3.10.0 AS mt-gateway
1118

19+
RUN mkdir -p /etc/metrictank
20+
COPY scripts/config/storage-schemas.conf /etc/metrictank/storage-schemas.conf
21+
COPY --from=gobase /tmp/build/mt-gateway /usr/bin/
22+
23+
EXPOSE 6059
24+
25+
ENTRYPOINT ["/usr/bin/mt-gateway"]
26+
27+
#########################
28+
# main metrictank image #
29+
#########################
1230
FROM alpine:3.10.0
1331
MAINTAINER Dieter Plaetinck dieter@grafana.com
1432

scripts/build_docker.sh

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ then
1414
docker tag grafana/metrictank grafana/metrictank:$tag
1515
docker tag grafana/metrictank grafana/metrictank:$version
1616

17+
docker build -t grafana/mt-gateway --target=mt-gateway -f ${DIR}/Dockerfile .
18+
docker tag grafana/mt-gateway grafana/mt-gateway:$tag
19+
docker tag grafana/mt-gateway grafana/mt-gateway:$version
20+
1721
# k8s image
1822
cd ${DIR}/k8s
1923
docker build -t us.gcr.io/metrictank-gcr/metrictank .

scripts/push/dockerhub.sh

+13
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,16 @@ echo "### docker push grafana/metrictank:$tag"
1616
echo
1717

1818
docker push grafana/metrictank:$tag
19+
20+
21+
echo
22+
echo "### docker push grafana/mt-gateway:$version"
23+
echo
24+
25+
docker push grafana/mt-gateway:$version
26+
27+
echo
28+
echo "### docker push grafana/mt-gateway:$tag"
29+
echo
30+
31+
docker push grafana/mt-gateway:$tag

0 commit comments

Comments
 (0)