Skip to content

Commit

Permalink
Fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
haxorof committed Apr 26, 2017
1 parent 7f9b80a commit 4044af3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
FROM alpine:3.5
FROM frolvlad/alpine-glibc:alpine-3.5

COPY ./dist/linux-amd64/prometheus-sql /
ARG PROMETHEUS_SQL_VERSION=1.0.0
ARG BASE_URL=https://github.com/chop-dbhi/prometheus-sql/releases/download/$PROMETHEUS_SQL_VERSION
ARG OS_ARCH=linux-amd64
ARG ZIP_FILE=prometheus-sql-${OS_ARCH}.zip

ADD $BASE_URL/$ZIP_FILE /tmp/
RUN unzip /tmp/$ZIP_FILE -d /tmp \
&& cp /tmp/$OS_ARCH/* /usr/local/bin/ \
&& rm -rf /tmp/*

EXPOSE 8080

ENTRYPOINT ["/prometheus-sql", "-host", "0.0.0.0"]
ENTRYPOINT ["/usr/local/bin/prometheus-sql", "-host", "0.0.0.0"]

# Default command assumes the SQL agent is linked.
CMD ["-service", "http://sqlagent:5000"]
CMD ["-service", "http://sqlagent:5000"]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@ Alternately, use the `docker-compose.yml` file included in this repository. The

## How To Build

### Build distribution binaries
### Build distribution packages

This section describes how you build prometheus-sql distribution binaries.
This section describes how you build prometheus-sql distribution packages.

1. Build prometheus-sql binaries for several platforms:
1. Build prometheus-sql packages for several platforms:

Using Make:
```bash
make prepare dist-build
make prepare dist
```

Using Docker:
```bash
docker run --rm -v ${PWD}:/go/bin -v ${PWD}:/usr/src/myapp -w /usr/src/myapp golang:1.8 bash -c 'make prepare dist-build'
docker run --rm -v ${PWD}:/go/bin -v ${PWD}:/usr/src/myapp -w /usr/src/myapp golang:1.8 bash -c 'apt-get update && apt-get -y install zip && make prepare dist'
```

1. All binaries produced are now located in directories under the `dist` directory.
Expand Down

0 comments on commit 4044af3

Please sign in to comment.