09/09/2018 - DOCKER, GIT
I assume that you have a GitHub and Docker Hub accounts. Also I assume that you have your application repository in GitHub and don't have the image in Docker Hub yet. Now we will see how to automatically build docker image in our Docker Hub account after pushing code changes to our GitHub repository. Our GitHub repository name is called
inanzzz/hello_php and we don't have the image in Docker Hub account yet. For more information read Configure automated builds on Docker Hub page.
│ ├── a.php
│ └── b.php
│ ├── docker-compose.yml
│ ├── .env
│ └── php
│ └── Dockerfile
3 directories, 5 files
Go to your Docker Hub account and click "Link Accounts" button under "Create > Create Automated Build" menu option. Follow the instructions to finish linking. This is a very easy process.
Master, Dockerfile Location:
/docker/php, Docker Tag Name:
latest. This will rebuild the image when git push event takes place in GitHub and tag the image with
latest. You can see the image tagged as
latestunder "Tags" tab.
As soon as you complete GitHub steps above, Docker Hub will start building. You can check it under "Build Details" tab in Docker Hub.