Skip to content

Commit d9d084b

Browse files
committed
feat: python3
1 parent 32e87f8 commit d9d084b

8 files changed

Lines changed: 58 additions & 219 deletions

File tree

.github/workflows/alpine.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ jobs:
109109
uses: docker/metadata-action@v5.6.1
110110
with:
111111
images: |
112-
name=snowdreamtech/base,enable=true
113-
name=ghcr.io/snowdreamtech/base,enable=true
114-
name=quay.io/snowdreamtech/base,enable=true
112+
name=snowdreamtech/python,enable=true
113+
name=ghcr.io/snowdreamtech/python,enable=true
114+
name=quay.io/snowdreamtech/python,enable=true
115115
flavor: |
116116
latest=false
117117
prefix=

.github/workflows/debian.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ jobs:
109109
uses: docker/metadata-action@v5.6.1
110110
with:
111111
images: |
112-
name=snowdreamtech/base,enable=true
113-
name=ghcr.io/snowdreamtech/base,enable=true
114-
name=quay.io/snowdreamtech/base,enable=true
112+
name=snowdreamtech/python,enable=true
113+
name=ghcr.io/snowdreamtech/python,enable=true
114+
name=quay.io/snowdreamtech/python,enable=true
115115
flavor: |
116116
latest=false
117117
prefix=

.github/workflows/description.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
DOCKER_USER: ${{ secrets.DOCKER_HUB_USERNAME }}
2424
DOCKER_PASS: ${{ secrets.DOCKER_HUB_TOKEN }}
2525
with:
26-
destination_container_repo: snowdreamtech/base
26+
destination_container_repo: snowdreamtech/python
2727
provider: dockerhub
2828
short_description: ${{ github.event.repository.description }}
2929
readme_file: "README.md"
@@ -32,6 +32,6 @@ jobs:
3232
env:
3333
DOCKER_APIKEY: ${{ secrets.QUAY_API_TOKEN }}
3434
with:
35-
destination_container_repo: quay.io/snowdreamtech/base
35+
destination_container_repo: quay.io/snowdreamtech/python
3636
provider: quay
3737
readme_file: "README.md"

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Base
1+
# Python
22

3-
[![Base](http://dockeri.co/image/snowdreamtech/base)](https://hub.docker.com/r/snowdreamtech/base)
3+
[![Python](http://dockeri.co/image/snowdreamtech/python)](https://hub.docker.com/r/snowdreamtech/python)
44

5-
Docker Image packaging for Base. (amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, mips64le, ppc64le,riscv64, s390x)
5+
Docker Image packaging for Python. (amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, mips64le, ppc64le,riscv64, s390x)
66

77
# Usage
88

@@ -14,21 +14,21 @@ To help you get started creating a container from this image you can either use
1414

1515
```bash
1616
docker run -d \
17-
--name=base \
17+
--name=python \
1818
-e TZ=Asia/Shanghai \
1919
--restart unless-stopped \
20-
snowdreamtech/base:latest
20+
snowdreamtech/python:latest
2121
```
2222

2323
### Advance
2424

2525
```bash
2626
docker run -d \
27-
--name=base \
27+
--name=python \
2828
-e TZ=Asia/Shanghai \
2929
-v /path/to/data:/path/to/data \
3030
--restart unless-stopped \
31-
snowdreamtech/base:latest
31+
snowdreamtech/python:latest
3232
```
3333

3434
## Docker Compose
@@ -37,9 +37,9 @@ docker run -d \
3737

3838
```bash
3939
services:
40-
base:
41-
image: snowdreamtech/base:latest
42-
container_name: base
40+
python:
41+
image: snowdreamtech/python:latest
42+
container_name: python
4343
environment:
4444
- TZ=Asia/Shanghai
4545
restart: unless-stopped
@@ -49,9 +49,9 @@ services:
4949

5050
```bash
5151
services:
52-
base:
53-
image: snowdreamtech/base:latest
54-
container_name: base
52+
python:
53+
image: snowdreamtech/python:latest
54+
container_name: python
5555
environment:
5656
- TZ=Asia/Shanghai
5757
volumes:
@@ -63,7 +63,7 @@ services:
6363

6464
```bash
6565
docker buildx create --use --name build --node build --driver-opt network=host
66-
docker buildx build -t snowdreamtech/base --platform=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/riscv64,linux/s390x . --push
66+
docker buildx build -t snowdreamtech/python --platform=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/riscv64,linux/s390x . --push
6767
```
6868

6969
## Reference
@@ -75,7 +75,7 @@ docker buildx build -t snowdreamtech/base --platform=linux/386,linux/amd64,linux
7575
1. [Faster Multi-Platform Builds: Dockerfile Cross-Compilation Guide](https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/)
7676
1. [docker/buildx](https://github.com/docker/buildx)
7777

78-
## Contact (备注:base)
78+
## Contact (备注:python)
7979

8080
* Email: sn0wdr1am@qq.com
8181
* QQ: 3217680847

alpine/Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@ FROM snowdreamtech/alpine:3.21.0
22

33
# OCI annotations to image
44
LABEL org.opencontainers.image.authors="Snowdream Tech" \
5-
org.opencontainers.image.title="Base Image Based On Alpine" \
6-
org.opencontainers.image.description="Docker Images for Base on Alpine. (i386, amd64, arm32v6, arm32v7, arm64, ppc64le,riscv64, s390x)" \
7-
org.opencontainers.image.documentation="https://hub.docker.com/r/snowdreamtech/base" \
8-
org.opencontainers.image.base.name="snowdreamtech/base:alpine" \
5+
org.opencontainers.image.title="Python Image Based On Alpine" \
6+
org.opencontainers.image.description="Docker Images for Python on Alpine. (i386, amd64, arm32v6, arm32v7, arm64, ppc64le,riscv64, s390x)" \
7+
org.opencontainers.image.documentation="https://hub.docker.com/r/snowdreamtech/python" \
8+
org.opencontainers.image.base.name="snowdreamtech/python:alpine" \
99
org.opencontainers.image.licenses="MIT" \
10-
org.opencontainers.image.source="https://github.com/snowdreamtech/base" \
10+
org.opencontainers.image.source="https://github.com/snowdreamtech/python" \
1111
org.opencontainers.image.vendor="Snowdream Tech" \
1212
org.opencontainers.image.version="3.21.0" \
13-
org.opencontainers.image.url="https://github.com/snowdreamtech/base"
13+
org.opencontainers.image.url="https://github.com/snowdreamtech/python"
1414

15-
# keep the docker container running
16-
ENV KEEPALIVE=1
15+
# This hack is widely applied to avoid python printing issues in docker containers.
16+
# See: https://github.com/Docker-Hub-frolvlad/docker-alpine-python3/pull/13
17+
ENV PYTHONUNBUFFERED=1
18+
19+
ENV PYTHON_VERSION=3.12.8-r1
1720

1821
ARG GID=1000 \
1922
UID=1000 \
20-
USER=base \
21-
WORKDIR=/home/base
23+
USER=python \
24+
WORKDIR=/home/python
2225

2326
# Create a user with UID and GID
2427
RUN if [ "${USER}" != "root" ]; then \
@@ -28,7 +31,11 @@ RUN if [ "${USER}" != "root" ]; then \
2831
fi
2932

3033
RUN apk add --no-cache \
31-
vim
34+
python3=${PYTHON_VERSION} \
35+
py3-pip \
36+
py3-setuptools \
37+
py3-virtualenv
38+
3239

3340
# Switch to the user
3441
USER ${USER}

alpine/README.md

Lines changed: 0 additions & 87 deletions
This file was deleted.

debian/Dockerfile

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@ FROM snowdreamtech/debian:12.8.0
22

33
# OCI annotations to image
44
LABEL org.opencontainers.image.authors="Snowdream Tech" \
5-
org.opencontainers.image.title="Base Image Based On Debian" \
6-
org.opencontainers.image.description="Docker Images for Base on Debian. (i386,amd64,arm32v5,arm32v7,arm64,mips64le,ppc64le,s390x)" \
7-
org.opencontainers.image.documentation="https://hub.docker.com/r/snowdreamtech/base" \
8-
org.opencontainers.image.base.name="snowdreamtech/base:debian" \
5+
org.opencontainers.image.title="Python Image Based On Debian" \
6+
org.opencontainers.image.description="Docker Images for Python on Debian. (i386,amd64,arm32v5,arm32v7,arm64,mips64le,ppc64le,s390x)" \
7+
org.opencontainers.image.documentation="https://hub.docker.com/r/snowdreamtech/python" \
8+
org.opencontainers.image.base.name="snowdreamtech/python:debian" \
99
org.opencontainers.image.licenses="MIT" \
10-
org.opencontainers.image.source="https://github.com/snowdreamtech/base" \
10+
org.opencontainers.image.source="https://github.com/snowdreamtech/python" \
1111
org.opencontainers.image.vendor="Snowdream Tech" \
1212
org.opencontainers.image.version="12.8" \
13-
org.opencontainers.image.url="https://github.com/snowdreamtech/base"
13+
org.opencontainers.image.url="https://github.com/snowdreamtech/python"
1414

15-
# keep the docker container running
16-
ENV KEEPALIVE=1
15+
# This hack is widely applied to avoid python printing issues in docker containers.
16+
# See: https://github.com/Docker-Hub-frolvlad/docker-alpine-python3/pull/13
17+
ENV PYTHONUNBUFFERED=1
18+
19+
ENV PYTHON_VERSION=3.11.2-1+b1
1720

1821
ARG GID=1000 \
1922
UID=1000 \
20-
USER=base \
21-
WORKDIR=/home/base
23+
USER=python \
24+
WORKDIR=/home/python
2225

2326
# Create a user with UID and GID
2427
RUN set -eux \
@@ -36,7 +39,10 @@ RUN set -eux \
3639
RUN set -eux \
3740
&& apt-get -qqy update \
3841
&& apt-get -qqy install --no-install-recommends \
39-
vim \
42+
python3=${PYTHON_VERSION} \
43+
python3-pip \
44+
python3-setuptools \
45+
python3-venv \
4046
&& apt-get -qqy --purge autoremove \
4147
&& apt-get -qqy clean \
4248
&& rm -rf /var/lib/apt/lists/* \

debian/README.md

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)