-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish Multi-Arch images using github actions #31
Conversation
…er-dhcp repository
updated
@waqarrashid33 This is a great start! Now comes the comments. ;)
As you can probably notice, I'm not familiar with GitHub Actions, hence all the questions. I have worked some with Bitbucket Pipelines, so CI/CD is not completely unfamiliar to me. |
For just running the existing image, you can find it on docker hub
wickywaka/docker-dhcpd.
…On Wed, Jun 1, 2022, 20:31 Waqar Rashid ***@***.***> wrote:
Hi Robin,
I haven't given it much thought consider this as an MVP.
1. No reason, I think 20.04 should be fine. 22.04 is too new for my taste.
2. From what I have read, we can change the trigger when make/push a tag
in GitHub. It can also be so that it takes the tag as tag for docker image
e.g docker-dhcpd:3.2 etc. There are lots of possibilities in this area.
This is my first time using GitHub Actions.
3. Good question, I don't know how to update when base image changes.
4. I think it uses qemu only for building images whose architecture is
different than host. On my system the amd64 image was always finishing its
build first because it was probably running natively.
On Wed, Jun 1, 2022, 16:46 Robin Smidsrød ***@***.***>
wrote:
> @waqarrashid33 <https://github.com/waqarrashid33> This is a great start!
> Now comes the comments. ;)
>
> 1. Any reason why the build environment uses ubuntu 18.04 instead of
> the newer 20.04 or 22.04? Are the steps not compatible with the newest OS
> versions?
> 2. I noticed you're just directly pushing the :latest tag. Is there
> any way to push a specific version, or push a build-artifact named after
> the digest? I'd like to be able to push dev versions of the images so it is
> easier to collaborate on testing before doing a new release.
> 3. I found the secrets setup in *Settings*, so that part should be
> okay, but when does this workflow trigger? I'm assuming it triggers when
> code enters the master branch. How would this work for numbered releases.
> How about recurring rebuilds when the base ubuntu image updates?
> 4. Just curious: Do you need QEMU when making an x86/x64 image? Is
> this just the best way to create multiarch images?
>
> As you can probably notice, I'm not familiar with GitHub Actions, hence
> all the questions. I have worked some with Bitbucket Pipelines, so CI/CD is
> not completely unfamiliar to me.
>
> —
> Reply to this email directly, view it on GitHub
> <#31 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABVDYA5LOKQI2M6JL6ZYPJ3VM5ZT7ANCNFSM5XQMTWBA>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Hi @robinsmidsrod ,
No reason, I think 20.04 should be fine. 22.04 is too new for my taste.
From what I have read about GitHub Actions, we can change the trigger when make/push a tag in GitHub. It can also be so that it takes the tag as tag for docker image e.g docker-dhcpd:3.2 etc. There are lots of possibilities in this area. This is my first time using GitHub Actions. So definitely some work to do here.
I think it uses qemu only for building images whose architecture is different than host. On my system the amd64 image was always finishing its build first because it was probably running natively.
I am new to this as well but we can learn from each other. |
found this while trying to stand up docker dns & dhcp on a rpi, look forward to this landing on docker hub! what you could do is have 1 job that runs on every commit and pushes to latest, and then another that runs on version tags:
and then grab the tag with |
Hello, and thank your for this PR. Tagging the result of This would require to run the workflow on git tags (1) and to extract the git's tag name to construct the docker's tag name (2). Example for (1) on:
push:
tags:
- * See Github's workflow syntax documentation. Example for (2) steps:
- uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "foobar-(.*)" # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
tagRegexGroup: 1 # Optional. Default is 1.
- name: Some other step # Output usage example
with:
tagname: ${{ steps.tagName.outputs.tag }}
- name: Yet another step # Environment variabl usage example
run: |
docker build . --file Dockerfile --tag docker.pkg.github.com/someimage:$GIT_TAG_NAME See actions/get-tag-name documentation. Additionally2, it would be nice if the publishing of git tag x.y.z would publish the docker tags |
Hey guys, |
@wickywaka |
@yscialom Lets see if I can finish it up today. Anyway I have added you as collaborator to the fork so that you can make the desired changes into the merge request. |
@wickywaka Great work! This is coming along nicely! Good job on getting the semver version parsed correctly. I do notice two things that should probably be fixed before we merge it.
|
|
|
Can you check if this is what you expected: |
I think its ready as well. |
Thanks. I will try to add this.
…On Sun, Jun 5, 2022, 20:32 kt ***@***.***> wrote:
found this while trying to stand up docker dns & dhcp on a rpi, look
forward to this landing on docker hub!
what you could do is have 1 job that runs on every commit and pushes to
latest, and then another that runs on version tags:
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
and then grab the tag with ${{ steps.vars.outputs.tag }} or ${{
env.RELEASE_VERSION }} and pop that into the docker tag name (and even do
multiple base versions of the os like here
https://hub.docker.com/r/ubuntu/bind9/tags)
—
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVDYA6ALT4UTXZK5ZFT72LVNTXC7ANCNFSM5XQMTWBA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi Robin,
I haven't given it much thought consider this as an MVP.
1. No reason, I think 20.04 should be fine. 22.04 is too new for my taste.
2. From what I have read, we can change the trigger when make/push a tag in
GitHub. It can also be so that it takes the tag as tag for docker image e.g
docker-dhcpd:3.2 etc. There are lots of possibilities in this area. This is
my first time using GitHub Actions.
3. Good question, I don't know how to update when base image changes.
4. I think it uses qemu only for building images whose architecture is
different than host. On my system the amd64 image was always finishing its
build first because it was probably running natively.
…On Wed, Jun 1, 2022, 16:46 Robin Smidsrød ***@***.***> wrote:
@waqarrashid33 <https://github.com/waqarrashid33> This is a great start!
Now comes the comments. ;)
1. Any reason why the build environment uses ubuntu 18.04 instead of
the newer 20.04 or 22.04? Are the steps not compatible with the newest OS
versions?
2. I noticed you're just directly pushing the :latest tag. Is there
any way to push a specific version, or push a build-artifact named after
the digest? I'd like to be able to push dev versions of the images so it is
easier to collaborate on testing before doing a new release.
3. I found the secrets setup in *Settings*, so that part should be
okay, but when does this workflow trigger? I'm assuming it triggers when
code enters the master branch. How would this work for numbered releases.
How about recurring rebuilds when the base ubuntu image updates?
4. Just curious: Do you need QEMU when making an x86/x64 image? Is
this just the best way to create multiarch images?
As you can probably notice, I'm not familiar with GitHub Actions, hence
all the questions. I have worked some with Bitbucket Pipelines, so CI/CD is
not completely unfamiliar to me.
—
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVDYA5LOKQI2M6JL6ZYPJ3VM5ZT7ANCNFSM5XQMTWBA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I manage to publish multi-arch images using GitHub Actions and here is the merge request. There are still open questions and I was doing it while learning at the same time so please suggest what can be improved.
It uses GitHub secrets for docker hub username and token with following names DOCKER_HUB_USERNAME, DOCKER_HUB_TOKEN. Please the docker.yml file for more details.
Related Issue: #23