New image Fedora 32 + Python 3.8 (synced from upstream)
This commit is contained in:
parent
1425f4c95f
commit
4fb1f66d7a
9 changed files with 56 additions and 79 deletions
12
Dockerfile
12
Dockerfile
|
|
@ -1,10 +1,10 @@
|
|||
# This image provides a Python 3.7 environment you can use to run your Python
|
||||
# This image provides a Python 3.8 environment you can use to run your Python
|
||||
# applications.
|
||||
FROM registry.fedoraproject.org/f31/s2i-base:latest
|
||||
FROM registry.fedoraproject.org/f32/s2i-base:latest
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENV PYTHON_VERSION=3.7 \
|
||||
ENV PYTHON_VERSION=3.8 \
|
||||
PATH=$HOME/.local/bin/:$PATH \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONIOENCODING=UTF-8 \
|
||||
|
|
@ -29,13 +29,13 @@ on most platforms."
|
|||
LABEL summary="$SUMMARY" \
|
||||
description="$DESCRIPTION" \
|
||||
io.k8s.description="$DESCRIPTION" \
|
||||
io.k8s.display-name="Python 3.7" \
|
||||
io.k8s.display-name="Python 3.8" \
|
||||
io.openshift.expose-services="8080:http" \
|
||||
io.openshift.tags="builder,python,python37,python-37,rh-python37" \
|
||||
io.openshift.tags="builder,python,python38,python-38,rh-python38" \
|
||||
com.redhat.component="$NAME" \
|
||||
name="$FGC/$NAME" \
|
||||
version="$VERSION" \
|
||||
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.7/test/setup-test-app/ $FGC/$NAME python-sample-app" \
|
||||
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.8/test/setup-test-app/ $FGC/$NAME python-sample-app" \
|
||||
maintainer="SoftwareCollections.org <sclorg@redhat.com>"
|
||||
|
||||
RUN INSTALL_PKGS="python3 python3-devel python3-setuptools python3-pip python3-virtualenv \
|
||||
|
|
|
|||
22
README.md
22
README.md
|
|
@ -1,7 +1,7 @@
|
|||
Python 3.7 container image
|
||||
Python 3.8 container image
|
||||
===================
|
||||
|
||||
This container image includes Python 3.7 as a [S2I](https://github.com/openshift/source-to-image) base image for your Python 3.7 applications.
|
||||
This container image includes Python 3.8 as a [S2I](https://github.com/openshift/source-to-image) base image for your Python 3.8 applications.
|
||||
Users can choose between RHEL and CentOS based builder images.
|
||||
The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/),
|
||||
the CentOS images are available on [Docker Hub](https://hub.docker.com/r/centos/),
|
||||
|
|
@ -14,15 +14,17 @@ Note: while the examples in this README are calling `podman`, you can replace an
|
|||
Description
|
||||
-----------
|
||||
|
||||
Python 3.7 available as container is a base platform for
|
||||
building and running various Python 3.7 applications and frameworks.
|
||||
Python 3.8 available as container is a base platform for
|
||||
building and running various Python 3.8 applications and frameworks.
|
||||
Python is an easy to learn, powerful programming language. It has efficient high-level
|
||||
data structures and a simple but effective approach to object-oriented programming.
|
||||
Python's elegant syntax and dynamic typing, together with its interpreted nature,
|
||||
make it an ideal language for scripting and rapid application development in many areas
|
||||
on most platforms.
|
||||
|
||||
This container image includes an npm utility, so users can use it to install JavaScript
|
||||
This container image includes an npm utility
|
||||
(see [base image repository](https://github.com/sclorg/s2i-base-container/tree/master/base)),
|
||||
so users can use it to install JavaScript
|
||||
modules for their web applications. There is no guarantee for any specific npm or nodejs
|
||||
version, that is included in the image; those versions can be changed anytime and
|
||||
the nodejs itself is included just to make the npm work.
|
||||
|
|
@ -30,18 +32,18 @@ the nodejs itself is included just to make the npm work.
|
|||
Usage
|
||||
---------------------
|
||||
|
||||
For this, we will assume that you are using the `rhscl/python-37-rhel7 image`, available via `python:3.7` imagestream tag in Openshift.
|
||||
Building a simple [python-sample-app](https://github.com/sclorg/s2i-python-container/tree/master/3.7/test/setup-test-app) application
|
||||
For this, we will assume that you are using the `rhscl/python-38-rhel7 image`, available via `python:3.8` imagestream tag in Openshift.
|
||||
Building a simple [python-sample-app](https://github.com/sclorg/s2i-python-container/tree/master/3.8/test/setup-test-app) application
|
||||
in Openshift can be achieved with the following step:
|
||||
|
||||
```
|
||||
oc new-app python:3.6~https://github.com/sclorg/s2i-python-container.git --context-dir=3.7/test/setup-test-app/
|
||||
oc new-app python:3.8~https://github.com/sclorg/s2i-python-container.git --context-dir=3.8/test/setup-test-app/
|
||||
```
|
||||
|
||||
The same application can also be built using the standalone [S2I](https://github.com/openshift/source-to-image) application on systems that have it available:
|
||||
|
||||
```
|
||||
$ s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.7/test/setup-test-app/ rhscl/python-37-rhel7 python-sample-app
|
||||
$ s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.8/test/setup-test-app/ rhscl/python-38-rhel7 python-sample-app
|
||||
```
|
||||
|
||||
**Accessing the application:**
|
||||
|
|
@ -82,7 +84,7 @@ file inside your source code repository.
|
|||
|
||||
If using `setup.py` for installing the application, the `MODULE_NAME` part
|
||||
can be read from there. For an example, see
|
||||
[setup-test-app](https://github.com/sclorg/s2i-python-container/tree/master/3.7/test/setup-test-app).
|
||||
[setup-test-app](https://github.com/sclorg/s2i-python-container/tree/master/3.8/test/setup-test-app).
|
||||
|
||||
* **APP_HOME**
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
unset BASH_ENV PROMPT_COMMAND ENV
|
||||
if head "/etc/redhat-release" | grep -q "^CentOS Linux release 7" || \
|
||||
head "/etc/redhat-release" | grep -q "^Red Hat Enterprise Linux\( Server\)\? release 7"; then
|
||||
source scl_source enable httpd24 $NODEJS_SCL rh-python37
|
||||
source scl_source enable httpd24 $NODEJS_SCL rh-python38
|
||||
fi
|
||||
source /opt/app-root/bin/activate
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ NAMESPACE=centos
|
|||
[[ $DISTRO =~ rhel* ]] && NAMESPACE=rhscl
|
||||
|
||||
cat <<EOF
|
||||
This is a S2I python-3.7 ${DISTRO} base image:
|
||||
This is a S2I python-3.8 ${DISTRO} base image:
|
||||
To use it, install S2I: https://github.com/openshift/source-to-image
|
||||
|
||||
Sample invocation:
|
||||
|
||||
s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.7/test/setup-test-app/ ${NAMESPACE}/python-37-${DISTRO}7 python-sample-app
|
||||
s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.8/test/setup-test-app/ ${NAMESPACE}/python-38-${DISTRO}7 python-sample-app
|
||||
|
||||
|
||||
You can then run the resulting image via:
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Django==1.11.23
|
||||
Django==1.11.28
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@ requests = "==2.20.0"
|
|||
pytest = ">=2.8.0"
|
||||
|
||||
[requires]
|
||||
python_version = "3.7"
|
||||
python_version = "3.8"
|
||||
|
|
|
|||
68
test/pipenv-test-app/Pipfile.lock
generated
68
test/pipenv-test-app/Pipfile.lock
generated
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "dbe9d3f790514385bed543a5fc1e85759ad0d0e39028c102d82c8d4afc1a5fc3"
|
||||
"sha256": "f1d3ff05e8c9143e751780c871a656ef8794c15cf6e8ef08cfa211ad25a24320"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
"python_version": "3.7"
|
||||
"python_version": "3.8"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
|
|
@ -18,10 +18,10 @@
|
|||
"default": {
|
||||
"certifi": {
|
||||
"hashes": [
|
||||
"sha256:e4f3620cfea4f83eedc95b24abd9cd56f3c4b146dd0177e83a21b4eb49e21e50",
|
||||
"sha256:fd7c7c74727ddcf00e9acd26bba8da604ffec95bf1c2144e67aff7a8b50e6cef"
|
||||
"sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3",
|
||||
"sha256:25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f"
|
||||
],
|
||||
"version": "==2019.9.11"
|
||||
"version": "==2019.11.28"
|
||||
},
|
||||
"chardet": {
|
||||
"hashes": [
|
||||
|
|
@ -36,10 +36,10 @@
|
|||
},
|
||||
"gunicorn": {
|
||||
"hashes": [
|
||||
"sha256:aa8e0b40b4157b36a5df5e599f45c9c76d6af43845ba3b3b0efe2c70473c2471",
|
||||
"sha256:fa2662097c66f920f53f70621c6c58ca4a3c4d3434205e608e121b5b3b71f4f3"
|
||||
"sha256:1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626",
|
||||
"sha256:cd4a810dd51bf497552cf3f863b575dabd73d6ad6a91075b65936b151cbf4f9c"
|
||||
],
|
||||
"version": "==19.9.0"
|
||||
"version": "==20.0.4"
|
||||
},
|
||||
"idna": {
|
||||
"hashes": [
|
||||
|
|
@ -65,13 +65,6 @@
|
|||
}
|
||||
},
|
||||
"develop": {
|
||||
"atomicwrites": {
|
||||
"hashes": [
|
||||
"sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4",
|
||||
"sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"
|
||||
],
|
||||
"version": "==1.3.0"
|
||||
},
|
||||
"attrs": {
|
||||
"hashes": [
|
||||
"sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
|
||||
|
|
@ -79,20 +72,12 @@
|
|||
],
|
||||
"version": "==19.3.0"
|
||||
},
|
||||
"importlib-metadata": {
|
||||
"hashes": [
|
||||
"sha256:aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26",
|
||||
"sha256:d5f18a79777f3aa179c145737780282e27b508fc8fd688cb17c7a813e8bd39af"
|
||||
],
|
||||
"markers": "python_version < '3.8'",
|
||||
"version": "==0.23"
|
||||
},
|
||||
"more-itertools": {
|
||||
"hashes": [
|
||||
"sha256:409cd48d4db7052af495b09dec721011634af3753ae1ef92d2b32f73a745f832",
|
||||
"sha256:92b8c4b06dac4f0611c0729b2f2ede52b2e1bac1ab48f089c7ddc12e26bb60c4"
|
||||
"sha256:b84b238cce0d9adad5ed87e745778d20a3f8487d0f0cb8b8a586816c7496458d",
|
||||
"sha256:c833ef592a0324bcc6a60e48440da07645063c453880c9477ceb22490aec1564"
|
||||
],
|
||||
"version": "==7.2.0"
|
||||
"version": "==8.0.2"
|
||||
},
|
||||
"packaging": {
|
||||
"hashes": [
|
||||
|
|
@ -103,10 +88,10 @@
|
|||
},
|
||||
"pluggy": {
|
||||
"hashes": [
|
||||
"sha256:0db4b7601aae1d35b4a033282da476845aa19185c1e6964b25cf324b5e4ec3e6",
|
||||
"sha256:fa5fa1622fa6dd5c030e9cad086fa19ef6a0cf6d7a2d12318e10cb49d6d68f34"
|
||||
"sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0",
|
||||
"sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"
|
||||
],
|
||||
"version": "==0.13.0"
|
||||
"version": "==0.13.1"
|
||||
},
|
||||
"py": {
|
||||
"hashes": [
|
||||
|
|
@ -117,25 +102,25 @@
|
|||
},
|
||||
"pyparsing": {
|
||||
"hashes": [
|
||||
"sha256:6f98a7b9397e206d78cc01df10131398f1c8b8510a2f4d97d9abd82e1aacdd80",
|
||||
"sha256:d9338df12903bbf5d65a0e4e87c2161968b10d2e489652bb47001d82a9b028b4"
|
||||
"sha256:20f995ecd72f2a1f4bf6b072b63b22e2eb457836601e76d6e5dfcd75436acc1f",
|
||||
"sha256:4ca62001be367f01bd3e92ecbb79070272a9d4964dce6a48a82ff0b8bc7e683a"
|
||||
],
|
||||
"version": "==2.4.2"
|
||||
"version": "==2.4.5"
|
||||
},
|
||||
"pytest": {
|
||||
"hashes": [
|
||||
"sha256:27abc3fef618a01bebb1f0d6d303d2816a99aa87a5968ebc32fe971be91eb1e6",
|
||||
"sha256:58cee9e09242937e136dbb3dab466116ba20d6b7828c7620f23947f37eb4dae4"
|
||||
"sha256:63344a2e3bce2e4d522fd62b4fdebb647c019f1f9e4ca075debbd13219db4418",
|
||||
"sha256:f67403f33b2b1d25a6756184077394167fe5e2f9d8bdaab30707d19ccec35427"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==5.2.2"
|
||||
"version": "==5.3.1"
|
||||
},
|
||||
"six": {
|
||||
"hashes": [
|
||||
"sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
|
||||
"sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
|
||||
"sha256:1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd",
|
||||
"sha256:30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"
|
||||
],
|
||||
"version": "==1.12.0"
|
||||
"version": "==1.13.0"
|
||||
},
|
||||
"wcwidth": {
|
||||
"hashes": [
|
||||
|
|
@ -143,13 +128,6 @@
|
|||
"sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c"
|
||||
],
|
||||
"version": "==0.1.7"
|
||||
},
|
||||
"zipp": {
|
||||
"hashes": [
|
||||
"sha256:3718b1cbcd963c7d4c5511a8240812904164b7f381b647143a89d3b98f9bcd8e",
|
||||
"sha256:f06903e9f1f43b12d371004b4ac7b06ab39a44adc747266928ae6debfa7b3335"
|
||||
],
|
||||
"version": "==0.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,8 +290,7 @@ function ct_os_new_project() {
|
|||
oc create -f "$OPENSHIFT_CLUSTER_PULLSECRET_PATH"
|
||||
# add registry pullsecret to the serviceaccount if provided
|
||||
secret_name=$(grep '^\s*name:' "$OPENSHIFT_CLUSTER_PULLSECRET_PATH" | awk '{ print $2 }')
|
||||
secret_json='{"imagePullSecrets": [{"name": "'${secret_name}'"}]}'
|
||||
oc patch serviceaccount default -p "$secret_json"
|
||||
oc secrets link --for=pull default "$secret_name"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -597,15 +596,14 @@ function ct_os_test_s2i_app_func() {
|
|||
if [ "${CT_SKIP_UPLOAD_IMAGE:-false}" == 'true' ] ; then
|
||||
if [ -n "${import_image}" ] ; then
|
||||
echo "Importing image ${import_image} as ${image_name}:${VERSION}"
|
||||
oc import-image "${image_name}":"${VERSION}" --from "${import_image}" --confirm
|
||||
# Use --reference-policy=local to pull remote image content to the cluster
|
||||
# Works around the issue of builder pods not having access to registry.redhat.io
|
||||
oc import-image "${image_name}":"${VERSION}" --from "${import_image}" --confirm --reference-policy=local
|
||||
else
|
||||
echo "Uploading and importing image skipped."
|
||||
fi
|
||||
else
|
||||
if [ -n "${import_image}" ] ; then
|
||||
echo "Warning: Import image ${import_image} requested, but uploading image ${image_name} instead."
|
||||
fi
|
||||
ct_os_upload_image "${image_name}" "${image_tagged}"
|
||||
ct_os_upload_image "${import_image:-$image_name}" "${image_tagged}"
|
||||
fi
|
||||
|
||||
local app_param="${app}"
|
||||
|
|
@ -728,15 +726,14 @@ function ct_os_test_template_app_func() {
|
|||
if [ "${CT_SKIP_UPLOAD_IMAGE:-false}" == 'true' ] ; then
|
||||
if [ -n "${import_image}" ] ; then
|
||||
echo "Importing image ${import_image} as ${image_name}:${VERSION}"
|
||||
oc import-image "${image_name}":"${VERSION}" --from "${import_image}" --confirm
|
||||
# Use --reference-policy=local to pull remote image content to the cluster
|
||||
# Works around the issue of builder pods not having access to registry.redhat.io
|
||||
oc import-image "${image_name}":"${VERSION}" --from "${import_image}" --confirm --reference-policy=local
|
||||
else
|
||||
echo "Uploading and importing image skipped."
|
||||
fi
|
||||
else
|
||||
if [ -n "${import_image}" ] ; then
|
||||
echo "Warning: Import image ${import_image} requested, but uploading image ${image_name} instead."
|
||||
fi
|
||||
ct_os_upload_image "${image_name}" "${image_tagged}"
|
||||
ct_os_upload_image "${import_image:-$image_name}" "${image_tagged}"
|
||||
|
||||
# upload also other images, that template might need (list of pairs in the format <image>|<tag>
|
||||
local image_tag_a
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ function ct_npm_works() {
|
|||
local tmpdir
|
||||
tmpdir=$(mktemp -d)
|
||||
: " Testing npm in the container image"
|
||||
cid_file="${tmpdir}/cid"
|
||||
local cid_file="${tmpdir}/cid"
|
||||
if ! docker run --rm "${IMAGE_NAME}" /bin/bash -c "npm --version" >"${tmpdir}/version" ; then
|
||||
echo "ERROR: 'npm --version' does not work inside the image ${IMAGE_NAME}." >&2
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue