Skip to content

How to push Dockerfile to docker hub

Roman Ivanov edited this page Dec 23, 2019 · 18 revisions
  1. create user on docker hub (become part of "checkstyle" organization)

  2. At folder sonar-checkstyle/checkstyle-sonar-plugin/config do

docker rm sonarqube-X.X-community
docker build -t sonarqube-maven-git .

launch it and make sure it works docker run -d --name sonarqube-X.X-community -p 9000:9000 -p 9092:9092 sonarqube-maven-git

recheck that service is up - http://localhost:9000/about

do commit of Dockerfile , and store commit SHA for tag creation (see next step)

git add .
git commit -m "config: update sonarqube base image to X.X-community"
git push origin master
git rev-parse --short HEAD
  1. docker tag sonarqube-maven-git:latest checkstyle/sonarqube-maven-git:X.X-community-<SHA>

  2. docker login --username=<user username>

  3. docker push checkstyle/sonarqube-maven-git

Image location - https://hub.docker.com/r/checkstyle/sonarqube-maven-git/