<commit_before>FROM resin/rpi-raspbian:jessie

LABEL org.label-schema.schema-version="1.0" \
      org.label-schema.name="grafana" \
      org.label-schema.description="Grafana" \
      org.label-schema.version="4.4.1" \
      org.label-schema.docker.cmd="docker run -d -p 3000:3000 -v data:/var/lib/grafana -v log:/var/log/grafana tcjennings/rpi-grafana" \
      org.label-schema.build-date="2016-07-12" \
      com.tobyjennings.base-image="resin/rpi-raspbian:jessie" \
      com.tobyjennings.architecture="arm6hf" 

RUN apt-get update \
 && apt-get upgrade -y \
 && apt-get install -y libfontconfig wget \
 && wget -O /tmp/grafana.deb https://github.com/tcjennings/raspberrypi-packages/raw/master/grafana/v4.4.1/grafana_4.4.1-1499878572_armhf.deb \
 && dpkg -i /tmp/grafana.deb \
 && apt-get clean \
 && rm -rf /tmp/* 

VOLUME /var/lib/grafana
VOLUME /var/log/grafana

EXPOSE 3000

ENV GF_PATHS_DATA /var/lib/grafana/
ENV GF_PATHS_PLUGINS /var/lib/grafana/plugins
ENV GF_PATHS_LOGS /var/log/grafana/

ENTRYPOINT ["/usr/sbin/grafana-server"]
CMD ["-config","/etc/grafana/grafana.ini","-homepath","/usr/share/grafana"]

<commit_msg>Update grafana to 4.6.3 using multi-stage build<commit_after>FROM resin/rpi-raspbian:latest as builder

RUN buildDeps='curl gcc g++ git libsqlite3-0 libfontconfig1 libicu52' \
	&& set -x \
	&& apt-get update && apt-get install -y $buildDeps \
	&& rm -rf /var/lib/apt/lists/*

ARG node_version=8.9.4
ARG node_architecture=armv7l
RUN curl https://nodejs.org/dist/v${node_version}/node-v${node_version}-linux-${node_architecture}.tar.xz \
  | tar -xJvf - --strip-components=1 -C /usr/local/

RUN curl https://raw.githubusercontent.com/timstanley1985/phantomjs-linux-armv6l/master/phantomjs-2.1.1-linux-armv6l.tar.gz \
  | tar xzf - -C /usr/local --strip-components=1 --no-same-permissions --no-same-owner

ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV GOOS linux
ENV GOARCH arm
ENV GO_VERSION 1.9.2

RUN mkdir -p /usr/local/go \
	&& curl -SLO "https://dl.google.com/go/go${GO_VERSION}.${GOOS}-armv6l.tar.gz" \
	&& tar -xzf "go$GO_VERSION.${GOOS}-armv6l.tar.gz" -C /usr/local/go --strip-components=1 \
	&& rm -f go$GO_VERSION.${GOOS}-armv6l.tar.gz \
        && mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

ARG grafana_ver=4.6.3

ENV NODE=/usr/local/bin/node
ENV NPM=/usr/local/bin/npm

WORKDIR $GOPATH

RUN go get -d github.com/grafana/grafana \
 || cd $GOPATH/src/github.com/grafana/grafana \
 && git checkout v${grafana_ver}

WORKDIR $GOPATH/src/github.com/grafana/grafana

RUN go run build.go setup
RUN go run build.go build
RUN $NPM install -g yarn

RUN apt-get update && apt-get install -y python2.7-minimal
RUN apt-get install -y python2.7
RUN apt-get install -y make
RUN ln -s /usr/bin/python2.7 /usr/bin/python2
RUN yarn install --pure-lockfile
RUN apt-get install -y ruby ruby-dev adduser
RUN gem install fpm
#RUN $NPM run watch
#RUN $NPM run jest
#RUN $NPM run karma
RUN go run build.go pkg-deb

FROM resin/rpi-raspbian:latest
ARG grafana_ver=4.6.3
COPY --from=builder /go/src/github.com/grafana/grafana/dist/grafana_${grafana_ver}-*_armhf.deb /tmp/grafana.deb
RUN apt-get update \
 && apt-get upgrade -y \
 && apt-get install -y libfontconfig \
 && dpkg -i /tmp/grafana.deb \
 && apt-get clean \
 && rm -rf /tmp/* \
 && rm -rf /var/lib/apt/lists/*

VOLUME /var/lib/grafana
VOLUME /var/log/grafana

EXPOSE 3000

ENV GF_PATHS_DATA /var/lib/grafana/
ENV GF_PATHS_PLUGINS /var/lib/grafana/plugins
ENV GF_PATHS_LOGS /var/log/grafana/

LABEL org.label-schema.schema-version="1.0" \
      org.label-schema.name="grafana" \
      org.label-schema.description="Grafana" \
      org.label-schema.version="${grafana_ver}" \
      org.label-schema.docker.cmd="docker run -d -p 3000:3000 -v data:/var/lib/grafana -v log:/var/log/grafana tcjennings/rpi-grafana" \
      org.label-schema.build-date="2018-01-21" \
      com.tobyjennings.base-image="resin/rpi-raspbian:jessie" \
      com.tobyjennings.architecture="arm6hf"

ENTRYPOINT ["/usr/sbin/grafana-server"]
CMD ["-config","/etc/grafana/grafana.ini","-homepath","/usr/share/grafana"]


{'fraction_non_alphanumeric': 0.16085271317829458, 'fraction_numerical': 0.02688953488372093, 'mean_word_length': 3.33718487394958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '733685', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1700, 'n_words': 310}