-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
92 additions
and
22 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,25 +1,30 @@ | ||
FROM java:8-jdk-alpine | ||
MAINTAINER coontact@echocat.org | ||
FROM alpine:3.4 | ||
MAINTAINER contact@echocat.org | ||
|
||
# Prepare build environment | ||
ENV LANG C.UTF-8 | ||
RUN apk update \ | ||
&& apk add --no-cache bash go openjdk8 | ||
COPY . /tmp/buildroot/site24x7_exporter | ||
RUN apk update && \ | ||
apk add bash go | ||
|
||
# Build exporter | ||
RUN cd /tmp/buildroot/site24x7_exporter && \ | ||
export GOROOT=/usr/lib/go && \ | ||
chmod +x /tmp/buildroot/site24x7_exporter/gradlew && \ | ||
./gradlew --stacktrace --info -Dplatforms=linux-amd64 build && \ | ||
cp /tmp/buildroot/site24x7_exporter/build/out/site24x7_exporter-linux-amd64 /usr/bin/site24x7_exporter && \ | ||
chmod +x /usr/bin/site24x7_exporter | ||
RUN cd /tmp/buildroot/site24x7_exporter \ | ||
&& export GOROOT=/usr/lib/go \ | ||
&& export JAVA_HOME=/usr/lib/jvm/default-jvm \ | ||
&& chmod +x /tmp/buildroot/site24x7_exporter/gradlew \ | ||
&& ./gradlew --stacktrace --info -Dplatforms=linux-amd64 build \ | ||
&& cp /tmp/buildroot/site24x7_exporter/build/out/site24x7_exporter-linux-amd64 /usr/bin/site24x7_exporter \ | ||
&& chmod +x /usr/bin/site24x7_exporter | ||
|
||
# Clean up build environment | ||
RUN apk del bash go readline ncurses-libs ncurses-terminfo ncurses-terminfo-base && \ | ||
rm -rf /var/cache/* && \ | ||
rm -rf /root/.go && \ | ||
rm -rf /root/.gradle && \ | ||
rm -rf /media && \ | ||
rm -rf /tmp/* | ||
RUN apk del \ | ||
bash readline ncurses-libs ncurses-terminfo ncurses-terminfo-base \ | ||
go \ | ||
libffi libtasn1 p11-kit p11-kit-trust ca-certificates java-cacerts libxau libxdmcp libxcb libx11 libxi libxrender libxtst libpng freetype libgcc giflib openjdk8-jre-lib java-common alsa-lib openjdk8-jre-base openjdk8-jre openjdk8 \ | ||
&& rm -rf /var/cache/* \ | ||
&& rm -rf /root/.go \ | ||
&& rm -rf /root/.gradle \ | ||
&& rm -rf /media \ | ||
&& rm -rf /tmp/* | ||
|
||
ENTRYPOINT ["/usr/bin/site24x7_exporter"] |
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
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