File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WORKDIR /root
77

88
SHELL [ "/bin/bash", "-c" ]
99

10-
ARG PYTHON_VERSION_TAG=3.8.0
10+
ARG PYTHON_VERSION_TAG=3.8.1
1111
ARG LINK_PYTHON_TO_PYTHON3=1
1212

1313
# Existing lsb_release causes issues with modern installations of Python3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
default: image
22

3-
all: image py_3.6.8 py_3.7.4
3+
all: image py_3.8.0 py_3.7.4 py_3.6.8
44

55
image:
6+
docker build -f Dockerfile \
7+
--cache-from matthewfeickert/docker-python3-ubuntu:latest \
8+
--build-arg PYTHON_VERSION_TAG=3.8.1 \
9+
--build-arg LINK_PYTHON_TO_PYTHON3=1 \
10+
-t matthewfeickert/docker-python3-ubuntu:latest \
11+
-t matthewfeickert/docker-python3-ubuntu:3.8.1 \
12+
--compress .
13+
14+
py_3.8.0:
615
docker build -f Dockerfile \
716
--cache-from matthewfeickert/docker-python3-ubuntu:latest \
817
--build-arg PYTHON_VERSION_TAG=3.8.0 \
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Python3 on Ubuntu Docker
22

3-
Dockerfile for image built off [Ubuntu 18.04](https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes/18.04) containing [Python 3.8](https://www.python.org/downloads/release/python-380/) ([Python 3.6](https://www.python.org/downloads/release/python-368/), [Python 3.7](https://www.python.org/downloads/release/python-374/)) built from source
3+
Dockerfile for image built off [Ubuntu 18.04](https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes/18.04) containing [Python 3.8](https://www.python.org/downloads/release/python-381/) ([Python 3.6](https://www.python.org/downloads/release/python-368/), [Python 3.7](https://www.python.org/downloads/release/python-374/)) built from source
44

55
[![Docker Automated build](https://img.shields.io/docker/automated/matthewfeickert/docker-python3-ubuntu.svg)](https://hub.docker.com/r/matthewfeickert/docker-python3-ubuntu/)
66
[![Docker Build Status](https://img.shields.io/docker/build/matthewfeickert/docker-python3-ubuntu.svg)](https://hub.docker.com/r/matthewfeickert/docker-python3-ubuntu/builds/)
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function download_cpython () {
1515
function set_num_processors {
1616
# Set the number of processors used for build
1717
# to be 1 less than are available
18-
if [[ -f "$(which nproc)" ]]; then
18+
if [[ -f "$(command -v nproc)" ]]; then
1919
NPROC="$(nproc)"
2020
else
2121
NPROC="$(grep -c '^processor' /proc/cpuinfo)"
@@ -74,16 +74,16 @@ function symlink_python_to_python3 {
7474
local python_version
7575
python_version="$(python3 --version)"
7676
local which_python
77-
which_python="$(which python3)${python_version:8:-2}"
77+
which_python="$(command -v python3)${python_version:8:-2}"
7878
local which_pip
79-
which_pip="$(which pip3)"
79+
which_pip="$(command -v pip3)"
8080

8181
# symlink python to python3
8282
printf "\n### ln -s -f %s %s\n" "${which_python}" "${which_python::-3}"
8383
ln -s -f "${which_python}" "${which_python::-3}"
8484

8585
# symlink pip to pip3 if no pip exists or it is a different version than pip3
86-
if [[ ! -z "$(which pip)" ]]; then
86+
if [[ -n "$(command -v pip)" ]]; then
8787
if [[ "$(pip --version)" = "$(pip3 --version)" ]]; then
8888
return 0
8989
fi
@@ -97,7 +97,7 @@ function main() {
9797
# 1: the Python version tag
9898
# 2: bool of if should symlink python and pip to python3 versions
9999

100-
PYTHON_VERSION_TAG=3.8.0
100+
PYTHON_VERSION_TAG=3.8.1
101101
LINK_PYTHON_TO_PYTHON3=0 # By default don't link so as to reserve python for Python 2
102102
if [[ $# -gt 0 ]]; then
103103
PYTHON_VERSION_TAG="${1}"

0 commit comments

Comments
 (0)