Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit e60128a

Browse files
committed
added README, test build, pip package list, update system packages and upgrade base image to 1.0.1
1 parent d0cc0d6 commit e60128a

6 files changed

Lines changed: 130 additions & 20 deletions

File tree

.drone.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
kind: pipeline
22
type: docker
3-
name: build-test-build
3+
name: build-test
44

55
platform:
66
os: linux
@@ -39,21 +39,17 @@ trigger:
3939
steps:
4040
- name: base_python_test
4141
image: fabiodcorreia/base-python:test
42-
# ports: [ 80 ]
4342
detach: true
4443
pull: always
4544
environment:
4645
PUID: "1000"
4746
PGID: "1000"
48-
49-
#- name: test image
50-
# image: python:2.7.18-alpine
51-
# commands:
52-
# - sleep 60
53-
# - sh ./test/start.sh
47+
commands:
48+
- sleep 60
49+
- sh ./test/start.sh
5450

5551
depends_on:
56-
- build-test-build
52+
- build-test
5753

5854
---
5955
kind: pipeline

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM fabiodcorreia/base-alpine:1.0.0
1+
FROM fabiodcorreia/base-alpine:1.0.1
22

33
ARG BUILD_DATE
44
ARG VERSION
@@ -12,9 +12,11 @@ RUN \
1212
python3 && \
1313
echo "**** install pip packages ****" && \
1414
pip install --no-cache-dir -U pip && \
15-
pip install -U \
16-
virtualenv && \
17-
echo "**** clean up ****" && \
18-
rm -rf \
19-
/root/.cache \
20-
/tmp/*
15+
pip install -U wheel && \
16+
echo "**** clean up ****" && \
17+
rm -rf \
18+
/root/.cache \
19+
/tmp/* &&\
20+
echo "**** make links ****" &&\
21+
ln -sf /usr/bin/python3 /usr/bin/python && \
22+
ln -sf /usr/bin/pip3 /usr/bin/pip

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Docker Python Base Image
2+
3+
![Maintenance](https://img.shields.io/maintenance/yes/2020?style=plastic) [![Drone Status](https://img.shields.io/drone/build/fabiodcorreia/docker-base-python?style=plastic)](https://cloud.drone.io/fabiodcorreia/docker-base-python) [![Latest Release](https://img.shields.io/github/v/release/fabiodcorreia/docker-base-python?style=plastic)](https://github.com/fabiodcorreia/docker-base-python/releases/latest) [![GitHub Licence](https://img.shields.io/github/license/fabiodcorreia/docker-base-python?style=plastic)](https://github.com/fabiodcorreia/docker-base-python/blob/master/LICENSE)
4+
5+
6+
![MicroBadger Layers](https://img.shields.io/microbadger/layers/fabiodcorreia/base-python?style=plastic) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/fabiodcorreia/base-python?style=plastic)](https://hub.docker.com/r/fabiodcorreia/base-python) [![Docker Pulls](https://img.shields.io/docker/pulls/fabiodcorreia/base-python?style=plastic)](https://hub.docker.com/r/fabiodcorreia/base-python) ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/fabiodcorreia/base-python?sort=semver&style=plastic)
7+
8+
A custom Python base image built with Alpine Linux.
9+
10+
## Base Packages
11+
12+
- python3
13+
- pip3
14+
- wheel
15+
16+
## Versioning
17+
18+
This image follows the [Semantic Versioning](https://semver.org/) pattern.
19+
20+
- **MAJOR** version - Changes on Base Image version (1.0.0 to 2.0.0)
21+
- **MINOR** version - Changes on Python version (3.8.3 to 3.8.4)
22+
- **PATCH** version - Package updates and other non breaking changes on the image
23+
- **DRAFT** version - Unstable build for review (Optional)
24+
25+
### Version Mapping
26+
27+
| Version | 1.0 | 1.1 | 2.0 |
28+
| :----: | --- | --- | ---- |
29+
| Base Image | 1.x.x | 1.x.x | 2.x.x |
30+
| Python | 3.8.3 | 3.8.4 | 3.8.3 |
31+
32+
When Base Image gets upgraded the major version is incremented, when Python gets upgraded the minor version is incremented.
33+
34+
## Tags
35+
36+
| Tag | Description |
37+
| :----: | --- |
38+
| latest | Latest version |
39+
| 1.0.0 | Specific patch version |
40+
| 1.0 | Specific minor version |
41+
| 1 | Specific major version |
42+
| 1.0.0-`arch` | Specific patch version to that `arch` |
43+
| 1.0-`arch` | Specific minor version to that `arch` |
44+
| 1-`arch` | Specific major version to that `arch` |
45+
| test | Branch version - **DO NOT USE** |
46+
47+
The version tags are the same as the repository versioning tags but without the `v`. The `test` version is only for build purposes, it should not be pulled.
48+
49+
The `arch` can be one of the supported architectures described below.
50+
51+
## Supported Architectures
52+
53+
| Architecture | Tag |
54+
| :----: | --- |
55+
| x86-64 | amd64 |
56+
| arm64 | arm64v8 |
57+
| armhf | arm32v7 |
58+
59+
60+
## Environment Variables
61+
62+
| Name | Description |
63+
| :-----------------: | ----------- |
64+
| PUID | Set the UserID - [Details](https://github.com/fabiodcorreia/docker-base-alpine#userid--groupid) |
65+
| PGID | Set the GroupID - [Details](https://github.com/fabiodcorreia/docker-base-alpine#userid--groupid) |
66+
| TZ | Set the system timezone - [Options](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |

package_versions.txt

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ libproc-3.3.16-r0
1919
libssl1.1-1.1.1g-r0
2020
libtls-standalone-2.9.1-r1
2121
linux-pam-1.3.1-r4
22-
musl-1.1.24-r8
23-
musl-utils-1.1.24-r8
22+
musl-1.1.24-r9
23+
musl-utils-1.1.24-r9
2424
ncurses-libs-6.2_p20200523-r0
2525
ncurses-terminfo-base-6.2_p20200523-r0
2626
procps-3.3.16-r0
@@ -60,3 +60,31 @@ tzdata-2020a-r0
6060
xz-5.2.5-r0
6161
xz-libs-5.2.5-r0
6262
zlib-1.2.11-r3
63+
==== Pip Packages ====
64+
CacheControl==0.12.6
65+
appdirs==1.4.4
66+
certifi==2020.4.5.1
67+
chardet==3.0.4
68+
colorama==0.4.3
69+
contextlib2==0.6.0
70+
distlib==0.3.0
71+
distro==1.5.0
72+
html5lib==1.0.1
73+
idna==2.9
74+
lockfile==0.12.2
75+
msgpack==1.0.0
76+
ordered-set==4.0.1
77+
packaging==20.4
78+
pep517==0.8.2
79+
pip==20.1.1
80+
progress==1.5
81+
pyparsing==2.4.7
82+
pytoml==0.1.21
83+
requests==2.23.0
84+
retrying==1.3.3
85+
setuptools==47.0.0
86+
six==1.15.0
87+
toml==0.10.1
88+
urllib3==1.25.9
89+
webencodings==0.5.1
90+
wheel==0.34.2

packages.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
22

3-
docker build . -t base-python
4-
docker run --rm --entrypoint '/bin/sh' -v ${PWD}:/tmp base-python -c '\
3+
IMAGE_NAME="base-python"
4+
docker image rm ${IMAGE_NAME}
5+
docker build . -t ${IMAGE_NAME}
6+
docker run --rm --entrypoint '/bin/sh' -v ${PWD}:/tmp ${IMAGE_NAME} -c '\
57
apk info -v | sort > /tmp/package_versions.txt && \
8+
echo "==== Pip Packages ====" >> /tmp/package_versions.txt && \
9+
pip3 list --format freeze | sort >> /tmp/package_versions.txt && \
610
chmod 777 /tmp/package_versions.txt'

test/start.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
PYTHON=`python --version`
4+
PIP=`pip --version`
5+
6+
if [ "$PYTHON" != "Python 3.8.3" ]; then
7+
echo "**** Python not found - $PYTHON ****"
8+
exit 1
9+
fi
10+
11+
if [ "$PIP" != "6.14.4" ]; then
12+
echo "**** PIP not found - $PIP ****"
13+
exit 1
14+
fi

0 commit comments

Comments
 (0)