Skip to content
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

Adds GH workflow to build docker images on version tags #1830

Merged
merged 3 commits into from
Apr 11, 2022

Conversation

vpereira01
Copy link
Contributor

Adds a GitHub workflow, and custom docker file, using docker buildx which builds docker container images for different CPU architectures and publishes these images to GitHub packages.

Workflow will automatically run when a version tag is created, pattern v*, example v0.23.0-beta. Also supports manual workflow trigger to allow the flexibility to build images without needing to create a new version tag.

Fixes: #1623

Example of how packages are listed from my fork https://github.com/vpereira01/btcd/pkgs/container/btcd

Few notes:

  • The step, Extract metadata (tags, labels) for Docker, will generate the tag latest when creating a tag v0.99 on master. Example from my fork: https://github.com/vpereira01/btcd/runs/5561633723?check_suite_focus=true . Not sure if this should be kept given the comments on wire: add proper types for flag field and improve docs #1632
  • I think the packages must be made public. GitHub seems to default packages to be private so anonymous docker pulls will not be allowed.
  • I have not used image digests on Dockerfile given the digest varies according to the TARGETARCH.
  • The platforms linux/amd64,linux/arm64,linux/arm,linux/386 seems good enough to cover must of uses cases. To support specific GOARM a lot rework is required.

References:

Adds a GitHub workflow, and custom docker file, using docker buildx
which builds docker container images for common platforms and publishes
these images to GitHub packages.
Copy link
Member

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three super minor comments.

.github/workflows/Dockerfile Outdated Show resolved Hide resolved
.github/workflows/Dockerfile Outdated Show resolved Hide resolved
.github/workflows/dimagespub.yml Outdated Show resolved Hide resolved
@jcvernaleo jcvernaleo self-assigned this Apr 9, 2022
Copy link
Member

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-build Docker images on CI
2 participants