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

Switch to Fedora 39 and buildx #5

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
32 changes: 14 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,35 @@ on:
- master
pull_request:
schedule:
- cron: "0 2 * * 0"

env:
DOCKER_BUILDKIT: 1
DOCKER_IMAGE: "acornsaustralia/python"
- cron: 0 2 * * 0
workflow_dispatch:

jobs:
main:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- uses: hadolint/[email protected]
- uses: hadolint/[email protected]
if: github.event_name == 'pull_request'
with:
dockerfile: Dockerfile
config: hadolint-ci.yaml

- name: Build image
run: docker-compose -f docker-compose.yml build

- name: Tag images
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
docker tag python:latest ${DOCKER_IMAGE}:latest
docker tag python:latest ${DOCKER_IMAGE}:${{ github.run_number }}
- name: Build images
run: docker buildx bake

- name: Log into registry
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login https://index.docker.io/v1/ -u ${{ secrets.DOCKER_USER }} --password-stdin

- name: Push images
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
docker push ${DOCKER_IMAGE}:latest
docker push ${DOCKER_IMAGE}:${{ github.run_number }}
run: docker buildx bake --push
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM registry.fedoraproject.org/fedora-minimal:36
ARG FEDORA_VERSION
FROM registry.fedoraproject.org/fedora-minimal:${FEDORA_VERSION}

RUN microdnf --nodocs -y upgrade && \
microdnf --nodocs -y install python3-pip && \
microdnf --nodocs -y install \
gcc \
postgresql-devel \
python3-devel \
python3-pip && \
microdnf --nodocs -y reinstall tzdata && \
microdnf clean all
microdnf clean all && \
rm -rf /var/cache/*
23 changes: 23 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
variable "GITHUB_RUN_NUMBER" {
default = null
}

group "default" {
targets = [
"python"
]
}

target "python" {
pull = true
tags = [
"acornsaustralia/python:latest",
GITHUB_RUN_NUMBER != null ? "acornsaustralia/python:${GITHUB_RUN_NUMBER}" : ""
]
platforms = [
"linux/amd64"
]
args = {
"FEDORA_VERSION" = "39"
}
}
6 changes: 0 additions & 6 deletions docker-compose.yml

This file was deleted.