IoTGateway/DockerHub

From ESS-WIKI
Jump to: navigation, search

This article tells you how to create an automated build on DockerHub.

Introduction

DockerHub is a cloud-based registry service which allows you to link to code repositories (e.g. GitHub), build your Docker images and test them, stores manually pushed images, etc.

Currently, we have many Docker images on DockerHub. In the section below, I will show you how to upload yours to the official registry.

Upload Dockerfile to GitHub

1. Register a GitHub account.

2. Join Advantech organizations.

3. Upload your Dockerfile to docker-images repository.

3-1. Create a new branch, e.g. u12.04-imx6LBV3.

Note: The naming rule is "<ubuntu version>-<project version>".

Git1.png


3-2. Add your Dockerfile in specific path, e.g. advrisc/u12.04-imx6LBV3

Note: The path is the name combining advrisc and <new branch>.

Git2.png


Set up DockerHub

1. Register a DockerHub account.

2. Join Advantech RISC organizations.

3. Link GitHub & DockerHub accounts. Dockerhub1.png


4. Create automated build. Dockerhub2.png


4-1. Create auto-build for GitHub.

4-2. Select docker-images repository. Dockerhub3.png


4-3. Fill in Repository Namespace & Name.

Note: The repository name is the same with your <new branch> name.

Dockerhub4.png


4-4. Configure Build Settings Dockerhub5.png

Note: Here we set trigger for both Branch & Tag types. In other words, 
when the branch on GitHub is pushed, DockerHub will trigger to build latest image.
When a tag is added on GitHub, DockerHub will trigger to build tag name image.


Trigger auto-build & Tag the image

1. Go back GitHub to update README.md for image information.

Note: This step will trigger auto-build for latest image!

Git3.png


2. If anything is good, add a tag for your Dockerfile.

Note: This step will trigger auto-build for tag name image!

Git4.png


3. Check the status of auto-build on DockerHub. Dockerhub6.png