How to submit Docker image to hub.docker.com? (OD-345)
Closed
Artur opened 3 years ago

Hi,

When using GitHub it is super easy. Docker has a built-in support for GitHub, so every time I commit to master branch a new Docker image is generated automatically.

However, if I want to skip on using GitHub entirely, what would be the best way to submit a new image version to Docker on commit?

Is there any support for this in 1dev?

Docker offers some REST API which could be used for this, but I guess it would require some plugin or component in 1dev to use it.

Robin Shen commented 3 years ago

You may create a CI job running each time upon branch update, and in this job build your docker image, and push to docker hub. For instance, OneDev publishes image upon each release via this script:

https://code.onedev.io/projects/onedev-server/blob/4486b1d9bcabc5e60ae688ed8d0736f2ffd3c1d5/.onedev-buildspec.yml?position=source-82.1-86.37-1&view-plain=true

You may choose to tag your image with build number (using variable @build_number@), commit id (using variable @commit_hash@) or some form of build version parsed from your project file.

Robin Shen changed state to 'Closed' 3 years ago
Previous Value Current Value
Open
Closed
Artur commented 3 years ago

Thank you, this works for me.

issue 1 of 1
Type
Question
Priority
Normal
Assignee
Issue Votes (0)
Watchers (3)
Reference
OD-345
Please wait...
Page is in error, reload to recover