Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 4.0 back since it's still supported upstream #5

Merged
merged 1 commit into from
Jun 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions 4.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM debian:jessie

# add our user and group first to make sure their IDs get assigned consistently
RUN groupadd -r kibana && useradd -r -g kibana kibana

RUN apt-get update && apt-get install -y ca-certificates curl --no-install-recommends && rm -rf /var/lib/apt/lists/*

# grab gosu for easy step-down from root
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
RUN arch="$(dpkg --print-architecture)" \
&& set -x \
&& curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.3/gosu-$arch" \
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.3/gosu-$arch.asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu

ENV KIBANA_VERSION 4.0.3
ENV KIBANA_SHA1 75312e930466430167a7e01be3ae41aeaf01a26c

RUN set -x \
&& curl -fSL "https://download.elastic.co/kibana/kibana/kibana-${KIBANA_VERSION}-linux-x64.tar.gz" -o kibana.tar.gz \
&& echo "${KIBANA_SHA1} kibana.tar.gz" | sha1sum -c - \
&& mkdir -p /opt/kibana \
&& tar -xz --strip-components=1 -C /opt/kibana -f kibana.tar.gz \
&& rm kibana.tar.gz

ENV PATH /opt/kibana/bin:$PATH

COPY ./docker-entrypoint.sh /

EXPOSE 5601
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["kibana"]
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions 4.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -e

# Add kibana as command if needed
if [[ "$1" == -* ]]; then
set -- kibana "$@"
fi

# Run as user "kibana" if the command is "kibana"
if [ "$1" = 'kibana' ]; then
if [ "$ELASTICSEARCH_URL" -o "$ELASTICSEARCH_PORT_9200_TCP" ]; then
: ${ELASTICSEARCH_URL:='http://elasticsearch:9200'}
sed -ri "s!^(elasticsearch_url:).*!\1 '$ELASTICSEARCH_URL'!" /opt/kibana/config/kibana.yml
else
echo >&2 'warning: missing ELASTICSEARCH_PORT_9200_TCP or ELASTICSEARCH_URL'
echo >&2 ' Did you forget to --link some-elasticsearch:elasticsearch'
echo >&2 ' or -e ELASTICSEARCH_URL=http://some-elasticsearch:9200 ?'
echo >&2
fi

set -- gosu kibana "$@"
fi

exec "$@"
31 changes: 20 additions & 11 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
#!/bin/bash
set -e

declare -A aliases=(
[4.1]='4 latest'
)

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

versions=( */ )
versions=( "${versions[@]%/}" )
url='git://github.com/docker-library/kibana'
commit="$(git log -1 --format="format:%H" -- .)"

echo '# maintainer: InfoSiftr <[email protected]> (@infosiftr)'

fullVersion="$(grep -m1 'ENV KIBANA_VERSION' Dockerfile | cut -d' ' -f3)"
versionAliases=()
while [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%[.-]*}"
done
versionAliases+=( $fullVersion latest )
for version in "${versions[@]}"; do
commit="$(git log -1 --format='format:%H' -- "$version")"
fullVersion="$(grep -m1 'ENV KIBANA_VERSION' "$version/Dockerfile" | cut -d' ' -f3)"

versionAliases=()
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%[.-]*}"
done
versionAliases+=( $version ${aliases[$version]} )

echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit}"
echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
done
done
26 changes: 17 additions & 9 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

versionPage="https://www.elastic.co$(curl -fsSL 'https://www.elastic.co/downloads/past-releases' |tac|tac | grep -m1 '"/downloads/past-releases/kibana-' | awk -F '[<>="]+' '{ print $4 }')"
fullVersion="$(curl -fsSL "$versionPage" | grep -Em1 '<a href="https://download.elastic.co/kibana/kibana/kibana-[^"]+-linux-x64.tar.gz"' | sed -r 's!^.*"https://download.elastic.co/kibana/kibana/kibana-|-linux-x64.tar.gz".*$!!g')"
sha1="$(curl -fsSL "https://download.elastic.co/kibana/kibana/kibana-$fullVersion-linux-x64.tar.gz.sha1.txt" | cut -d' ' -f1)"

set -x
sed -ri '
s/^(ENV KIBANA_VERSION) .*/\1 '"$fullVersion"'/;
s/^(ENV KIBANA_SHA1) .*/\1 '"$sha1"'/;
' Dockerfile
versions=( */ )
versions=( "${versions[@]%/}" )

downloadable="$(curl -sSL 'https://www.elastic.co/downloads/past-releases' | sed -rn 's!.*?/downloads/past-releases/(kibana-)?[0-9]+-[0-9]+-[0-9]+">Kibana ([0-9]+\.[0-9]+\.[0-9]+)<.*!\2!gp')"

for version in "${versions[@]}"; do
fullVersion="$(echo "$downloadable" | grep -m1 "^$version")"
sha1="$(curl -fsSL "https://download.elastic.co/kibana/kibana/kibana-$fullVersion-linux-x64.tar.gz.sha1.txt" | cut -d' ' -f1)"

(
set -x
sed -ri '
s/^(ENV KIBANA_VERSION) .*/\1 '"$fullVersion"'/;
s/^(ENV KIBANA_SHA1) .*/\1 '"$sha1"'/;
' "$version/Dockerfile"
)
done