Skip to content

Commit 7b06d79

Browse files
committed
feat: add python image
1 parent 9f0f379 commit 7b06d79

File tree

5 files changed

+103
-0
lines changed

5 files changed

+103
-0
lines changed

.github/workflows/python.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
name: python image
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "python/**"
9+
- ".github/workflows/python.yaml"
10+
workflow_dispatch:
11+
env:
12+
REGISTRY: "ghcr.io"
13+
NAMESPACE: "mskarbek/containers"
14+
IMAGE_NAME: "python"
15+
VERSION: "3.12.12"
16+
jobs:
17+
build-and-push-image:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
attestations: write
23+
id-token: write
24+
steps:
25+
- uses: actions/checkout@v5
26+
- uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
- id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}
35+
tags: |
36+
type=raw,value=${{ env.VERSION }}
37+
- id: push
38+
uses: docker/build-push-action@v5
39+
with:
40+
context: ./python/
41+
file: ./python/Containerfile
42+
push: true
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}
45+
build-and-push-devel-image:
46+
runs-on: ubuntu-latest
47+
permissions:
48+
contents: read
49+
packages: write
50+
attestations: write
51+
id-token: write
52+
steps:
53+
- uses: actions/checkout@v5
54+
- uses: docker/login-action@v3
55+
with:
56+
registry: ${{ env.REGISTRY }}
57+
username: ${{ github.actor }}
58+
password: ${{ secrets.GITHUB_TOKEN }}
59+
- id: meta
60+
uses: docker/metadata-action@v5
61+
with:
62+
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}-devel
63+
tags: |
64+
type=raw,value=${{ env.VERSION }}
65+
- id: push
66+
uses: docker/build-push-action@v5
67+
with:
68+
context: ./python/
69+
file: ./python/Containerfile.devel
70+
push: true
71+
tags: ${{ steps.meta.outputs.tags }}
72+
labels: ${{ steps.meta.outputs.labels }}

python/Containerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ghcr.io/mskarbek/containers/init:10.1
2+
3+
RUN dnf -y install\
4+
python3\
5+
python3-pip\
6+
python3-setuptools\
7+
python3-wheel\
8+
python3-pip-wheel\
9+
python3-setuptools-wheel;\
10+
dnf clean all;\
11+
cd /tmp;\
12+
curl -Lo uv.tar.gz https://github.com/astral-sh/uv/releases/download/0.9.27/uv-x86_64-unknown-linux-gnu.tar.gz;\
13+
tar xvf uv.tar.gz;\
14+
mv /tmp/uv-x86_64-unknown-linux-gnu/uvx /usr/local/bin/uvx;\
15+
mv /tmp/uv-x86_64-unknown-linux-gnu/uv /usr/local/bin/uv;\
16+
rm -rf /tmp/uv.tar.gz /tmp/uv-x86_64-unknown-linux-gnu

python/Containerfile.devel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ghcr.io/mskarbek/containers/python:3.12.12
2+
3+
RUN dnf -y install\
4+
python3-devel\
5+
libffi-devel\
6+
gcc\
7+
make;\
8+
dnf clean all

python/rootfs/etc/pip.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[global]
2+
trusted-host = ${REPOSITORY_PIP_TRUSTED_HOST}
3+
index = ${REPOSITORY_PIP_INDEX}
4+
index-url = ${REPOSITORY_PIP_INDEX_URL}

python/rootfs/root/.netrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
machine ${REPOSITORY_PIP_TRUSTED_HOST}
2+
login ${REPOSITORY_USERNAME}
3+
password ${REPOSITORY_PASSWORD}

0 commit comments

Comments
 (0)