init
Some checks failed
Some checks failed
This commit is contained in:
commit
bcc4ac9e4f
7 changed files with 365 additions and 0 deletions
238
.gitea/workflows/docker_build.yml
Normal file
238
.gitea/workflows/docker_build.yml
Normal file
|
@ -0,0 +1,238 @@
|
||||||
|
name: build docker container
|
||||||
|
run-name: ${{ gitea.actor }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches: [main, master]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.44net.ch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-py38:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: actions/runner-python38
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: setup docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: get container metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: metadata
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
prefix=
|
||||||
|
suffix=
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
|
- name: login to container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
if: gitea.event_name != 'pull_request'
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.CR_USERNAME }}
|
||||||
|
password: ${{ secrets.CR_PASSWORD }}
|
||||||
|
|
||||||
|
- name: build and push docker image @amd64+arm64
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: ${{ gitea.event_name != 'pull_request' }}
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.py38
|
||||||
|
provenance: false
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.metadata.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
BUILD_VERSION=${{ steps.metadata.outputs.version }}
|
||||||
|
BUILD_COMMIT=${{ gitea.sha }}
|
||||||
|
|
||||||
|
build-py39:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: actions/runner-python39
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: setup docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: get container metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: metadata
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
prefix=
|
||||||
|
suffix=
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
|
- name: login to container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
if: gitea.event_name != 'pull_request'
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.CR_USERNAME }}
|
||||||
|
password: ${{ secrets.CR_PASSWORD }}
|
||||||
|
|
||||||
|
- name: build and push docker image @amd64+arm64
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: ${{ gitea.event_name != 'pull_request' }}
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.py39
|
||||||
|
provenance: false
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.metadata.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
BUILD_VERSION=${{ steps.metadata.outputs.version }}
|
||||||
|
BUILD_COMMIT=${{ gitea.sha }}
|
||||||
|
|
||||||
|
build-py310:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: actions/runner-python310
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: setup docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: get container metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: metadata
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
prefix=
|
||||||
|
suffix=
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
|
- name: login to container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
if: gitea.event_name != 'pull_request'
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.CR_USERNAME }}
|
||||||
|
password: ${{ secrets.CR_PASSWORD }}
|
||||||
|
|
||||||
|
- name: build and push docker image @amd64+arm64
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: ${{ gitea.event_name != 'pull_request' }}
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.py310
|
||||||
|
provenance: false
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.metadata.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
BUILD_VERSION=${{ steps.metadata.outputs.version }}
|
||||||
|
BUILD_COMMIT=${{ gitea.sha }}
|
||||||
|
|
||||||
|
build-py311:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: actions/runner-python311
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: setup docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: get container metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: metadata
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
prefix=
|
||||||
|
suffix=
|
||||||
|
tags: |
|
||||||
|
type=schedule
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
type=sha
|
||||||
|
|
||||||
|
- name: login to container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
if: gitea.event_name != 'pull_request'
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.CR_USERNAME }}
|
||||||
|
password: ${{ secrets.CR_PASSWORD }}
|
||||||
|
|
||||||
|
- name: build and push docker image @amd64+arm64
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: ${{ gitea.event_name != 'pull_request' }}
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.py311
|
||||||
|
provenance: false
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.metadata.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
BUILD_VERSION=${{ steps.metadata.outputs.version }}
|
||||||
|
BUILD_COMMIT=${{ gitea.sha }}
|
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
28
Dockerfile.py310
Normal file
28
Dockerfile.py310
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
FROM catthehacker/ubuntu:runner-22.04
|
||||||
|
|
||||||
|
ENV PATH /usr/local/bin:$PATH
|
||||||
|
|
||||||
|
ENV PYVERSION="3.10"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "*** installing python ${PYVERSION} ***" \
|
||||||
|
&& sudo apt install -y software-properties-common wget \
|
||||||
|
&& sudo add-apt-repository -y ppa:deadsnakes/ppa \
|
||||||
|
&& sudo apt update \
|
||||||
|
&& sudo apt remove -y python3* \
|
||||||
|
&& sudo apt install -y "python${PYVERSION}" "python${PYVERSION}-full" "python${PYVERSION}-dev" \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python3 \
|
||||||
|
&& wget -q https://bootstrap.pypa.io/get-pip.py \
|
||||||
|
&& sudo python3 get-pip.py \
|
||||||
|
&& python3 -m pip install --upgrade pip wheel setuptools
|
||||||
|
|
||||||
|
# cleanup installation
|
||||||
|
RUN \
|
||||||
|
echo "**** cleanup ****" \
|
||||||
|
&& sudo apt-get purge --auto-remove -y \
|
||||||
|
&& sudo apt-get clean \
|
||||||
|
&& sudo rm -rf \
|
||||||
|
/tmp/* \
|
||||||
|
/var/lib/apt/lists/* \
|
||||||
|
/var/tmp/*
|
28
Dockerfile.py311
Normal file
28
Dockerfile.py311
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
FROM catthehacker/ubuntu:runner-22.04
|
||||||
|
|
||||||
|
ENV PATH /usr/local/bin:$PATH
|
||||||
|
|
||||||
|
ENV PYVERSION="3.11"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "*** installing python ${PYVERSION} ***" \
|
||||||
|
&& sudo apt install -y software-properties-common wget \
|
||||||
|
&& sudo add-apt-repository -y ppa:deadsnakes/ppa \
|
||||||
|
&& sudo apt update \
|
||||||
|
&& sudo apt remove -y python3* \
|
||||||
|
&& sudo apt install -y "python${PYVERSION}" "python${PYVERSION}-full" "python${PYVERSION}-dev" \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python3 \
|
||||||
|
&& wget -q https://bootstrap.pypa.io/get-pip.py \
|
||||||
|
&& sudo python3 get-pip.py \
|
||||||
|
&& python3 -m pip install --upgrade pip wheel setuptools
|
||||||
|
|
||||||
|
# cleanup installation
|
||||||
|
RUN \
|
||||||
|
echo "**** cleanup ****" \
|
||||||
|
&& sudo apt-get purge --auto-remove -y \
|
||||||
|
&& sudo apt-get clean \
|
||||||
|
&& sudo rm -rf \
|
||||||
|
/tmp/* \
|
||||||
|
/var/lib/apt/lists/* \
|
||||||
|
/var/tmp/*
|
28
Dockerfile.py38
Normal file
28
Dockerfile.py38
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
FROM catthehacker/ubuntu:runner-22.04
|
||||||
|
|
||||||
|
ENV PATH /usr/local/bin:$PATH
|
||||||
|
|
||||||
|
ENV PYVERSION="3.8"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "*** installing python ${PYVERSION} ***" \
|
||||||
|
&& sudo apt install -y software-properties-common wget \
|
||||||
|
&& sudo add-apt-repository -y ppa:deadsnakes/ppa \
|
||||||
|
&& sudo apt update \
|
||||||
|
&& sudo apt remove -y python3* \
|
||||||
|
&& sudo apt install -y "python${PYVERSION}" "python${PYVERSION}-full" "python${PYVERSION}-dev" \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python3 \
|
||||||
|
&& wget -q https://bootstrap.pypa.io/get-pip.py \
|
||||||
|
&& sudo python3 get-pip.py \
|
||||||
|
&& python3 -m pip install --upgrade pip wheel setuptools
|
||||||
|
|
||||||
|
# cleanup installation
|
||||||
|
RUN \
|
||||||
|
echo "**** cleanup ****" \
|
||||||
|
&& sudo apt-get purge --auto-remove -y \
|
||||||
|
&& sudo apt-get clean \
|
||||||
|
&& sudo rm -rf \
|
||||||
|
/tmp/* \
|
||||||
|
/var/lib/apt/lists/* \
|
||||||
|
/var/tmp/*
|
28
Dockerfile.py39
Normal file
28
Dockerfile.py39
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
FROM catthehacker/ubuntu:runner-22.04
|
||||||
|
|
||||||
|
ENV PATH /usr/local/bin:$PATH
|
||||||
|
|
||||||
|
ENV PYVERSION="3.9"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "*** installing python ${PYVERSION} ***" \
|
||||||
|
&& sudo apt install -y software-properties-common wget \
|
||||||
|
&& sudo add-apt-repository -y ppa:deadsnakes/ppa \
|
||||||
|
&& sudo apt update \
|
||||||
|
&& sudo apt remove -y python3* \
|
||||||
|
&& sudo apt install -y "python${PYVERSION}" "python${PYVERSION}-full" "python${PYVERSION}-dev" \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python \
|
||||||
|
&& sudo ln -s /usr/bin/python${PYVERSION} /usr/bin/python3 \
|
||||||
|
&& wget -q https://bootstrap.pypa.io/get-pip.py \
|
||||||
|
&& sudo python3 get-pip.py \
|
||||||
|
&& python3 -m pip install --upgrade pip wheel setuptools
|
||||||
|
|
||||||
|
# cleanup installation
|
||||||
|
RUN \
|
||||||
|
echo "**** cleanup ****" \
|
||||||
|
&& sudo apt-get purge --auto-remove -y \
|
||||||
|
&& sudo apt-get clean \
|
||||||
|
&& sudo rm -rf \
|
||||||
|
/tmp/* \
|
||||||
|
/var/lib/apt/lists/* \
|
||||||
|
/var/tmp/*
|
15
README.md
Normal file
15
README.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# gitea actions image for python
|
||||||
|
|
||||||
|
based on `catthehacker/ubuntu:runner-22.04`
|
||||||
|
|
||||||
|
### available images
|
||||||
|
|
||||||
|
`git.44net.ch/actions/runner-python38`
|
||||||
|
`git.44net.ch/actions/runner-python39`
|
||||||
|
`git.44net.ch/actions/runner-python310`
|
||||||
|
`git.44net.ch/actions/runner-python311`
|
||||||
|
|
||||||
|
### installed tools:
|
||||||
|
|
||||||
|
- python
|
||||||
|
- pip
|
Loading…
Reference in a new issue