-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8b32d6
commit 8529386
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# {{ image.pretty_name }} Container Image | ||
|
||
{% include 'badges.j2' %} | ||
|
||
## Description | ||
|
||
[Python](https://www.python.org/) is an interpreted, interactive, object-oriented, open-source programming language. It incorporates modules, exceptions, dynamic typing, high-level dynamic data types, and classes. It provides interfaces to many system calls, libraries, and various window systems, and it is extensible in C or C++. It is also usable as an extension language for applications that require programmable interfaces. | ||
|
||
## Usage | ||
|
||
To deploy an application, install dependencies, copy the sources, and configure the application's main script: | ||
|
||
```Dockerfile | ||
FROM {{ image.pretty_reference }} | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
|
||
CMD [ "python", "./main-script.py" ] | ||
``` | ||
|
||
Build and run the container image: | ||
|
||
```ShellSession | ||
$ podman build -t my-python-app . | ||
$ podman run -it --rm my-python-app | ||
``` | ||
|
||
To run a single script inside a container, use the following command: | ||
|
||
```ShellSession | ||
$ podman run --rm -v "$PWD":/app:Z -w /app {{ image.pretty_reference }} python3 script.py | ||
``` | ||
|
||
## Additional tools | ||
|
||
The following tools are included in the image: | ||
|
||
{% set has_pipx = image.is_opensuse or (image.os_version.is_sle15 and image.version == '3.11') -%} | ||
{% set has_wheel = image.is_opensuse or (image.os_version.is_sle15 and image.version == '3.6') -%} | ||
|
||
- python{{ image.version }}-devel | ||
- python{{ image.version }}-pip | ||
{% if has_pipx -%} | ||
- python{{ image.version }}-pipx | ||
{% endif -%} | ||
{% if has_wheel -%} | ||
- python{{ image.version }}-wheel | ||
{% endif -%} | ||
- curl | ||
- git-core | ||
|
||
{% include 'licensing_and_eula.j2' %} |