Skip to content

Commit

Permalink
Merge pull request #5 from groovytron/fix-missing-build-tools
Browse files Browse the repository at this point in the history
Add missing build tools needed by some wheels
  • Loading branch information
groovytron authored Apr 1, 2020
2 parents 15d241a + e3bb2af commit 41424cd
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
4 changes: 3 additions & 1 deletion 3.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ RUN apt-get update \
&& apt-get upgrade --quiet --yes \
&& apt-get update --quiet \
&& apt-get install --quiet --yes \
build-essential \
curl \
locales \
python${PYTHON_VERSION} \
python3-distutils \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-distutils \
python${PYTHON_VERSION}-venv \
software-properties-common \
tzdata \
Expand Down
4 changes: 3 additions & 1 deletion 3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ RUN apt-get update \
&& apt-get upgrade --quiet --yes \
&& apt-get update --quiet \
&& apt-get install --quiet --yes \
build-essential \
curl \
locales \
python${PYTHON_VERSION} \
python3-distutils \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-distutils \
python${PYTHON_VERSION}-venv \
software-properties-common \
tzdata \
Expand Down
4 changes: 3 additions & 1 deletion 3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ RUN apt-get update \
&& apt-get upgrade --quiet --yes \
&& apt-get update --quiet \
&& apt-get install --quiet --yes \
build-essential \
curl \
locales \
python${PYTHON_VERSION} \
python3-distutils \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-distutils \
python${PYTHON_VERSION}-venv \
software-properties-common \
tzdata \
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.0.1

- feature: add `publish` and `tag` targets to `Makefile` to make images publishing easier
- fix: add `build-essentials` and Python header files and static library to improve compatibility with some wheels (eg. [thriftpy2](https://github.com/Thriftpy/thriftpy2) which needs gcc and Python header files)

## 2.0.0

- feature: add image for Python 3.8 (issue #3)
Expand Down
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
BUILD_NAME=python
OWNER=groovytron
COMPOSE_BUILD_NAME=python-container
VERSIONS=3.8 3.7 3.6
LATEST=3.8
LATEST_LABEL=latest
ALL=$(addprefix python,$(VERSIONS))
VCS_REF="$(shell git rev-parse HEAD)"
BUILD_DATE="$(shell date -u +"%Y-%m-%dT%H:%m:%SZ")"
Expand All @@ -22,3 +25,21 @@ clean:
for VERSION in $(VERSIONS); do \
docker image rm -f $(COMPOSE_BUILD_NAME):$$VERSION; \
done

.PHONY:tag
tag:
for VERSION in $(VERSIONS); do \
docker tag $(COMPOSE_BUILD_NAME):$$VERSION $(OWNER)/$(BUILD_NAME):$$VERSION; \
done && \
docker tag $(COMPOSE_BUILD_NAME):$(LATEST) $(OWNER)/$(BUILD_NAME):$(LATEST_LABEL)

.PHONY:publish
publish: tag
for VERSION in $(VERSIONS); do \
docker push $(OWNER)/$(BUILD_NAME):$$VERSION; \
done && \
docker push $(OWNER)/$(BUILD_NAME):$(LATEST_LABEL)

.PHONY:clean-tests
clean-test:
rm -rf test_pipenv test_poetry
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Docker container allowing you to build and test your Python project. _This conta

[`poetry`](https://python-poetry.org/) is installed in every image to make Python dependencies installation easier. [`pipenv`](https://github.com/pypa/pipenv) is also installed if you prefer to use this solution for dependencies management.

The following dependencies are installed to make wheel installation work properly:

- [build-essentials](https://packages.ubuntu.com/bionic/build-essential) (`g++`, `gcc`, `make` and `libc6-dev`)
- [python-dev](https://packages.ubuntu.com/bionic-updates/python3.8-dev) (header files and static library for Python)

## Use the container

We recommend you use the `dev` user instead of `root` when running that container.
Expand Down

0 comments on commit 41424cd

Please sign in to comment.