-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dockerfile to Ubuntu 24.04 and add various improvements.
- Docker base image updated to Ubuntu 24.04 - Account for new ubuntu images now coming with default user 'ubuntu', which conflicted with adding a new user with default UID of 1000. - Conditionally add new user only if CONTAINER_USERNAME is not 'ubuntu' - Docker healthcheck added - Resolve buildx warnings - Add Github Actions
- Loading branch information
Showing
4 changed files
with
154 additions
and
66 deletions.
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,59 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-24.04 | ||
outputs: | ||
image_date: ${{ steps.date.outputs.image_date }} | ||
steps: | ||
- name: Set build date for image tagging | ||
id: date | ||
run: echo "image_date=$(date +'%Y.%m.%d')" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4.0.0 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: image=moby/buildkit:latest | ||
|
||
- name: Docker build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: false | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ steps.date.outputs.image_date }} | ||
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ github.sha }} | ||
- name: Docker compose build | ||
run: docker compose build | ||
|
||
push: | ||
needs: build | ||
runs-on: ubuntu-24.04 | ||
if: github.event_name == 'push' | ||
steps: | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ needs.build.outputs.image_date }} | ||
${{ secrets.DOCKERHUB_USERNAME }}/roon-server:${{ github.sha }} |
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