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
add multi arch docker build #5808
Merged
Merged
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
28eec20
Add multi arch container build
b-reich 7bd3a15
using label from github action
b-reich e3e72b4
dont remove static labels and split docker readme in seperate action
b-reich 1e2f4d4
pin 3rd party action to a commit
b-reich f29c107
enable pushing to dockerhub
b-reich 51497c9
Update .github/workflows/build-images.yml
b-reich 47e4520
remove not needed checkout
b-reich 9bae9fe
set github token permissions
b-reich 0e4a51d
Update .github/workflows/push-dockerhub-readme.yml
Alkarex 0ef449d
update docker readme to match new tags
b-reich 50f36c1
Apply suggestions from code review
Alkarex 735be30
Merge branch 'edge' into edge
Alkarex 3ea33af
fix suffix for alpine image
b-reich 8255ac7
fix suffix for alpine image
b-reich 97ff089
push images only at upstream repo
b-reich de09a2a
push images only at upstream repo
b-reich 1bf588a
push images only at upstream repo
b-reich 73f9417
tag latest-alpine as alpine
b-reich 8a09f8e
tag latest-alpine as alpine
b-reich b65b047
remove no needed falvor
b-reich b5aede3
keep falvor for build
b-reich 4de930b
Clean more things
Alkarex 0b041d0
Rename action
Alkarex fdc0807
Rename readme action
Alkarex d583cf8
Use default name for dockerhub-description
Alkarex 239b8e7
Experiment with build-args
Alkarex 6929640
Debug
Alkarex 34411c9
Add checkout back
Alkarex f5155d7
Revert back to metadata-action
Alkarex 78c57ed
Remove quotes in version
Alkarex 052d1ac
Try to fix variables
Alkarex bdeb0a0
Experiment with automatic label values again
Alkarex 5da2c90
Delete last Docker Hub hooks
Alkarex 3d110b8
Use only git SHA for org.opencontainers.image.revision
Alkarex 97af192
Comment out semver for now
Alkarex fd69343
Enable major semver
Alkarex File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Publish Docker images | ||
|
||
on: | ||
push: | ||
branches: | ||
- edge | ||
release: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
# packages: write | ||
|
||
jobs: | ||
build-container-image: | ||
name: Build Docker image ${{ matrix.name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- name: Debian | ||
file: Docker/Dockerfile | ||
flavor: | | ||
latest=auto | ||
tags: | | ||
type=edge | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/0.') }} | ||
- name: Alpine | ||
file: Docker/Dockerfile-Alpine | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=raw,value=alpine,enable=${{ github.ref == 'refs/heads/latest' || startsWith(github.ref, 'refs/tags/') }} | ||
type=edge,suffix=-alpine,onlatest=false | ||
type=semver,pattern={{version}}-alpine | ||
type=semver,pattern={{major}}.{{minor}}-alpine | ||
type=semver,pattern={{major}}-alpine,enable=${{ !startsWith(github.ref, 'refs/tags/0.') }} | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get FreshRSS version | ||
run: | | ||
FRESHRSS_VERSION=$(sed -n "s/^const FRESHRSS_VERSION = '\(.*\)'.*$/\1/p" constants.php) | ||
echo "$FRESHRSS_VERSION" | ||
echo "FRESHRSS_VERSION=$FRESHRSS_VERSION" >> $GITHUB_ENV | ||
|
||
- name: Add metadata to Docker images | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
flavor: ${{ matrix.flavor }} | ||
images: | | ||
docker.io/freshrss/freshrss | ||
# ghcr.io/${{ github.repository }} | ||
tags: ${{ matrix.tags }} | ||
labels: | | ||
org.opencontainers.image.revision=${{ github.ref_name }}.${{ github.sha }} | ||
org.opencontainers.image.version=${{ env.FRESHRSS_VERSION }} | ||
|
||
- name: Login to Docker Hub | ||
if: github.repository_owner == 'FreshRSS' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# - name: Login to GitHub Container Registry | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# registry: ghcr.io | ||
# username: ${{ github.repository_owner }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ${{ matrix.file }} | ||
platforms: linux/arm/v7,linux/arm64,linux/amd64 | ||
build-args: | | ||
FRESHRSS_VERSION=${{ env.FRESHRSS_VERSION }} | ||
SOURCE_BRANCH=${{ github.ref_name }} | ||
SOURCE_COMMIT=${{ github.sha }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: ${{ (github.ref == 'refs/heads/latest' || github.ref == 'refs/heads/edge' || startsWith(github.ref, 'refs/tags/')) && github.repository_owner == 'FreshRSS' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Update Docker Hub description | ||
|
||
on: | ||
push: | ||
paths: | ||
- Docker/README.md | ||
branches: | ||
- edge | ||
workflow_dispatch: | ||
|
||
jobs: | ||
dockerhub-description: | ||
if: github.repository_owner == 'FreshRSS' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Update repo description | ||
uses: peter-evans/dockerhub-description@dc67fad7001ef9e8e3c124cb7a64e16d0a63d864 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
repository: freshrss/freshrss | ||
readme-filepath: Docker/README.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already handle by the
org.opencontainers.image.revision
label which is the commit hashdont know if there is benefit to know which branch is build from, when you have the commit
also thinks the container version label is fine with sometthing like
1.22.2
or1.22.2-alpine
its specify the container version not the version of the application itselfThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly because this is what we already have, and I find it a bit easier to read with something like
1.22.1.cc2878aed855463efe36cf6fb96d001dbb75612e
. But I would not be much against leaving it to only the git SHA, if this is what is most standard.Edit: indeed, according to https://specs.opencontainers.org/image-spec/annotations/#pre-defined-annotation-keys : org.opencontainers.image.revision Source control revision identifier for the packaged software.
I will edit accordingly
I would also be happy with
1.22.2-alpine
, but that does not work for e.g.edge
buildsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched back to default revision 3d110b8