diff --git a/Dockerfile b/Dockerfile index 8b1bdc6..98c218c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,14 @@ -FROM frolvlad/alpine-glibc:alpine-3.5 - -ARG PROMETHEUS_SQL_VERSION=1.2.0 -ARG PKG_FILE=prometheus-sql-linux-amd64.tar.gz -ARG PKG_URL=https://github.com/chop-dbhi/prometheus-sql/releases/download/$PROMETHEUS_SQL_VERSION/$PKG_FILE - -RUN apk update -RUN apk add curl - -# Workaround to publish Github release before curl fetches it. -RUN sleep 60 - -RUN mkdir -p /opt/prometheus-sql/bin \ - && curl --retry 5 --retry-delay 15 --retry-max-time 120 -SL $PKG_URL \ - | tar -xzC /opt/prometheus-sql/bin \ - && ln -s /opt/prometheus-sql/bin/linux-amd64/prometheus-sql /usr/local/bin/ - -RUN apk del curl -RUN rm /var/cache/apk/* +# Requires Docker v17.06 or later +FROM golang:1.8.3 as builder +RUN mkdir -p /go/src/app +WORKDIR /go/src/app +COPY . /go/src/app +RUN go-wrapper download +RUN go-wrapper install +FROM frolvlad/alpine-glibc:alpine-3.5 +COPY --from=builder /go/bin/app /usr/local/bin/prometheus-sql EXPOSE 8080 - ENTRYPOINT ["/usr/local/bin/prometheus-sql", "-host", "0.0.0.0"] - # Default command assumes the SQL agent is linked. CMD ["-service", "http://sqlagent:5000"] \ No newline at end of file diff --git a/Dockerfile.multi b/Dockerfile.multi deleted file mode 100644 index 98c218c..0000000 --- a/Dockerfile.multi +++ /dev/null @@ -1,14 +0,0 @@ -# Requires Docker v17.06 or later -FROM golang:1.8.3 as builder -RUN mkdir -p /go/src/app -WORKDIR /go/src/app -COPY . /go/src/app -RUN go-wrapper download -RUN go-wrapper install - -FROM frolvlad/alpine-glibc:alpine-3.5 -COPY --from=builder /go/bin/app /usr/local/bin/prometheus-sql -EXPOSE 8080 -ENTRYPOINT ["/usr/local/bin/prometheus-sql", "-host", "0.0.0.0"] -# Default command assumes the SQL agent is linked. -CMD ["-service", "http://sqlagent:5000"] \ No newline at end of file