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

Commit

Permalink
added README, test build, pip package list, update system packages an…
Browse files Browse the repository at this point in the history
…d upgrade base image to 1.0.1
  • Loading branch information
fabiodcorreia committed Jul 9, 2020
1 parent d0cc0d6 commit e60128a
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 20 deletions.
14 changes: 5 additions & 9 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind: pipeline
type: docker
name: build-test-build
name: build-test

platform:
os: linux
Expand Down Expand Up @@ -39,21 +39,17 @@ trigger:
steps:
- name: base_python_test
image: fabiodcorreia/base-python:test
# ports: [ 80 ]
detach: true
pull: always
environment:
PUID: "1000"
PGID: "1000"

#- name: test image
# image: python:2.7.18-alpine
# commands:
# - sleep 60
# - sh ./test/start.sh
commands:
- sleep 60
- sh ./test/start.sh

depends_on:
- build-test-build
- build-test

---
kind: pipeline
Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fabiodcorreia/base-alpine:1.0.0
FROM fabiodcorreia/base-alpine:1.0.1

ARG BUILD_DATE
ARG VERSION
Expand All @@ -12,9 +12,11 @@ RUN \
python3 && \
echo "**** install pip packages ****" && \
pip install --no-cache-dir -U pip && \
pip install -U \
virtualenv && \
echo "**** clean up ****" && \
rm -rf \
/root/.cache \
/tmp/*
pip install -U wheel && \
echo "**** clean up ****" && \
rm -rf \
/root/.cache \
/tmp/* &&\
echo "**** make links ****" &&\
ln -sf /usr/bin/python3 /usr/bin/python && \
ln -sf /usr/bin/pip3 /usr/bin/pip
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Docker Python Base Image

![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)


![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)

A custom Python base image built with Alpine Linux.

## Base Packages

- python3
- pip3
- wheel

## Versioning

This image follows the [Semantic Versioning](https://semver.org/) pattern.

- **MAJOR** version - Changes on Base Image version (1.0.0 to 2.0.0)
- **MINOR** version - Changes on Python version (3.8.3 to 3.8.4)
- **PATCH** version - Package updates and other non breaking changes on the image
- **DRAFT** version - Unstable build for review (Optional)

### Version Mapping

| Version | 1.0 | 1.1 | 2.0 |
| :----: | --- | --- | ---- |
| Base Image | 1.x.x | 1.x.x | 2.x.x |
| Python | 3.8.3 | 3.8.4 | 3.8.3 |

When Base Image gets upgraded the major version is incremented, when Python gets upgraded the minor version is incremented.

## Tags

| Tag | Description |
| :----: | --- |
| latest | Latest version |
| 1.0.0 | Specific patch version |
| 1.0 | Specific minor version |
| 1 | Specific major version |
| 1.0.0-`arch` | Specific patch version to that `arch` |
| 1.0-`arch` | Specific minor version to that `arch` |
| 1-`arch` | Specific major version to that `arch` |
| test | Branch version - **DO NOT USE** |

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.

The `arch` can be one of the supported architectures described below.

## Supported Architectures

| Architecture | Tag |
| :----: | --- |
| x86-64 | amd64 |
| arm64 | arm64v8 |
| armhf | arm32v7 |


## Environment Variables

| Name | Description |
| :-----------------: | ----------- |
| PUID | Set the UserID - [Details](https://github.com/fabiodcorreia/docker-base-alpine#userid--groupid) |
| PGID | Set the GroupID - [Details](https://github.com/fabiodcorreia/docker-base-alpine#userid--groupid) |
| TZ | Set the system timezone - [Options](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |
32 changes: 30 additions & 2 deletions package_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ libproc-3.3.16-r0
libssl1.1-1.1.1g-r0
libtls-standalone-2.9.1-r1
linux-pam-1.3.1-r4
musl-1.1.24-r8
musl-utils-1.1.24-r8
musl-1.1.24-r9
musl-utils-1.1.24-r9
ncurses-libs-6.2_p20200523-r0
ncurses-terminfo-base-6.2_p20200523-r0
procps-3.3.16-r0
Expand Down Expand Up @@ -60,3 +60,31 @@ tzdata-2020a-r0
xz-5.2.5-r0
xz-libs-5.2.5-r0
zlib-1.2.11-r3
==== Pip Packages ====
CacheControl==0.12.6
appdirs==1.4.4
certifi==2020.4.5.1
chardet==3.0.4
colorama==0.4.3
contextlib2==0.6.0
distlib==0.3.0
distro==1.5.0
html5lib==1.0.1
idna==2.9
lockfile==0.12.2
msgpack==1.0.0
ordered-set==4.0.1
packaging==20.4
pep517==0.8.2
pip==20.1.1
progress==1.5
pyparsing==2.4.7
pytoml==0.1.21
requests==2.23.0
retrying==1.3.3
setuptools==47.0.0
six==1.15.0
toml==0.10.1
urllib3==1.25.9
webencodings==0.5.1
wheel==0.34.2
8 changes: 6 additions & 2 deletions packages.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash

docker build . -t base-python
docker run --rm --entrypoint '/bin/sh' -v ${PWD}:/tmp base-python -c '\
IMAGE_NAME="base-python"
docker image rm ${IMAGE_NAME}
docker build . -t ${IMAGE_NAME}
docker run --rm --entrypoint '/bin/sh' -v ${PWD}:/tmp ${IMAGE_NAME} -c '\
apk info -v | sort > /tmp/package_versions.txt && \
echo "==== Pip Packages ====" >> /tmp/package_versions.txt && \
pip3 list --format freeze | sort >> /tmp/package_versions.txt && \
chmod 777 /tmp/package_versions.txt'
14 changes: 14 additions & 0 deletions test/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

PYTHON=`python --version`
PIP=`pip --version`

if [ "$PYTHON" != "Python 3.8.3" ]; then
echo "**** Python not found - $PYTHON ****"
exit 1
fi

if [ "$PIP" != "6.14.4" ]; then
echo "**** PIP not found - $PIP ****"
exit 1
fi

0 comments on commit e60128a

Please sign in to comment.