Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into image-improvements
Browse files Browse the repository at this point in the history
* origin/master:
  make a target docker repo an optional param
  Only pushes to the latest tag for releases.
  Add workdir to dockerfile
  • Loading branch information
xlson committed Apr 3, 2018
2 parents 61f3782 + 4a4905f commit dc7e754
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ EXPOSE 3000
COPY ./run.sh /run.sh

USER grafana

ENTRYPOINT [ "/run.sh" ]
WORKDIR /
ENTRYPOINT [ "/run.sh" ]
7 changes: 4 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

_grafana_version=$1

_docker_repo=${2:-grafana/grafana}

if [ "$_grafana_version" != "" ]; then
echo "Building version ${_grafana_version}"
docker build \
--build-arg GRAFANA_VERSION=${_grafana_version} \
--tag "grafana/grafana:${_grafana_version}" \
--tag "${_docker_repo}:${_grafana_version}" \
--no-cache=true .
docker tag grafana/grafana:${_grafana_version} grafana/grafana:latest

docker tag ${_docker_repo}:${_grafana_version} ${_docker_repo}:latest
else
echo "Building latest for master"
docker build \
Expand Down
6 changes: 5 additions & 1 deletion push_to_docker_hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ _grafana_version=${_grafana_tag:1}
if [ "$_grafana_version" != "" ]; then
echo "pushing grafana/grafana:${_grafana_version}"
docker push grafana/grafana:${_grafana_version}
docker push grafana/grafana:latest

if echo "$_grafana_version" | grep -viqF beta; then
echo "pushing grafana/grafana:latest"
docker push grafana/grafana:latest
fi
else
echo "pushing grafana/grafana:master"
docker push grafana/grafana:master
Expand Down

0 comments on commit dc7e754

Please sign in to comment.