Difference between revisions of "IoTGateway/DockerHub"

From ESS-WIKI
Jump to: navigation, search
Line 16: Line 16:
 
3-1. Create a new branch, e.g. u12.04-imx6LBV3.
 
3-1. Create a new branch, e.g. u12.04-imx6LBV3.
 
  ''Note:'' The naming rule is "'''<ubuntu version>'''-'''<project version>'''".
 
  ''Note:'' The naming rule is "'''<ubuntu version>'''-'''<project version>'''".
 +
[[File:Git1.png]]
 +
 +
 
3-2. Add your Dockerfile in specific path, e.g. advrisc/u12.04-imx6LBV3
 
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>'''.
 
  ''Note:'' The path is the name combining '''advrisc''' and '''<new branch>'''.
3-3. Remember to update README.md for image information.
+
[[File:Git2.png]]
 +
 
  
 
==Set up DockerHub==
 
==Set up DockerHub==
Line 26: Line 30:
  
 
3. Link GitHub & DockerHub accounts.
 
3. Link GitHub & DockerHub accounts.
 +
[[File:dockerhub1.png|1024px]]
 +
 +
 +
4. Create automated build.
 +
[[File:dockerhub2.png|1024px]]
 +
 +
 +
4-1. Create auto-build for GitHub.
 +
 +
4-2. Select docker-images repository.
 +
[[File:dockerhub3.png|1024px]]
 +
 +
 +
4-3. Fill in Repository Namespace & Name.
 +
''Note:'' The repository name is the same with your '''<new branch>''' name.
 +
[[File:dockerhub4.png]]
 +
 +
 +
4-4. Configure Build Settings
 +
[[File:dockerhub5.png|1024px]]
 +
''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!
 +
[[File:Git3.png]]
 +
 +
 +
2. If anything is good, add a tag for your Dockerfile.
 +
''Note:'' This step will trigger auto-build for '''tag name''' image!
 +
[[File:Git4.png]]
  
4. Create automated build
 
  
4-1.
+
3. Check the status of auto-build on DockerHub.
 +
[[File:dockerhub6.png|1024px]]

Revision as of 11:58, 21 September 2016

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 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