Skip to content

Commit d9d50b4

Browse files
committed
feat: python-base image
1 parent 3552f68 commit d9d50b4

4 files changed

Lines changed: 55 additions & 1 deletion

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
jobs:
7+
build_and_push:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
image_config:
14+
- image_name: xieffect/python-base
15+
image_tag: python-3.13-poetry-2.1.2
16+
base_folder: python-base/
17+
build_args: |
18+
PYTHON_VERSION=3.13
19+
POETRY_VERSION=2.1.2
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Build and push
26+
uses: niqzart/ffs-devops/docker-build@main
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
30+
repository: ${{ matrix.image_config.image_name }}
31+
tag: ${{ matrix.image_config.image_tag }}
32+
context: ${{ matrix.image_config.base_folder }}
33+
dockerfile: ${{ matrix.image_config.base_folder }}/main.dockerfile
34+
arguments: ${{ matrix.image_config.build_args }}

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
Repository for basic docker images for use in other projects
33

44
### Images
5-
TBD
5+
#### python-base
6+
Basic docker image with the latest system & pip updates, sometimes bundled with a dependency manager, such as poetry
7+
8+
Tags are formed in a pattern: `python-{PYTHON_VERSION}-{PACKAGE_MANAGER}-{PACKAGE_MANAGER_VERSION}`, for example, `python-3.13-poetry-2.1.2` contains Python 3.13 and Poetry 2.1.2 with default configs (poetry is configured not to create virtual environments)
69

710
### Contribution
811
1. Clone the project and run `pre_commit install` to setup basic linters

compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
python_3.13_poetry_2.1.2:
3+
build:
4+
dockerfile: python-base/main.dockerfile
5+
args:
6+
PYTHON_VERSION: 3.13
7+
POETRY_VERSION: 2.1.2
8+
image: xieffect/python-base:python-3.13-poetry-2.1.2

python-base/main.dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG PYTHON_VERSION
2+
FROM python:${PYTHON_VERSION}-alpine
3+
4+
RUN apk upgrade --no-cache
5+
RUN pip install --upgrade pip
6+
7+
ARG POETRY_VERSION
8+
RUN pip install poetry==${POETRY_VERSION}
9+
RUN poetry config virtualenvs.create false

0 commit comments

Comments
 (0)