Good news! Python 3.12 has recently been released and Fedora 39 ships it in the system. We don’t have to replace existing Python installation in our operating system, but we could use the container to run the latest Python release for testing or other purposes.
Since Python 3.9 and Fedora 33, Python’s annual release cycle was adapted for Fedora. It is now common that Python is upgraded on a similar schedule in every odd-numbered Fedora release and it benefits us to build Python 3.12 container image from the Fedora 39 base image.
Containerization is a reliable solution to run multiple tasks or applications on the same host. The container allows applications to be bundled with their own libraries and configuration files, and then executed in isolation on a single OS kernel. It ensures application isolation in terms of security and data access, and as resource allocation.
A container image is a template containing a set of instructions for creating a container. It provides a convenient way to package up applications and preconfigured server environments, which you can use for your own private use or share publicly with other users.
Alpine is ideal for creating small and efficient container images, which can reduce the build time, the storage space, and the network bandwidth. It is designed to be simple, fast, and secure, with minimal dependencies and features. The image weighs in at under three megabytes and requires less than 100 megabytes of RAM to run, this makes it fast to download, it also means that Alpine container places minimal load on your system.
Before we begin to build the container images, let’s define a base image and a layered image. In simple terms, a base image is an empty first layer, which allows you to build your container images from scratch. When you create a container image, most Dockerfiles start from a parent image, a layered image adds a collections of layers on top of the parent image in order to install, configure, and run an application. Layered images reference base images in a Dockerfile using the FROM instruction:
If you need to completely control the contents of your image, you might need to create a base image instead. A base image has FROM scratch in its Dockerfile.
Flask is one of the most popular web application framework, it’s simple and lightweight framework for Python. At the time this writing, Flask version 2.3.x supports Python 3.8 and newer. We will prepare the application development environment with the latest version of Python and Flask.
Most of the latest Linux distributions ship the latest release of Python 3.11. Depend on the operating system, you may install Python from package manager.
In openSUSE, you can install Python 3.11 with this command:
Debian 12 (Bookworm) currently contains 3.11, but you need to install the Virtual Environment that it will be used for the development environment:
sudo apt install python3-venv
If you use Windows as development environment, the winget package manager can be used to download Python 3.11:
winget install Python.Python.3.11
You may download the source code and binary for your operating system from python.org .
Working with Virtual Environment
Use a virtual environment to manage the dependencies for your project, both in development and in production. A virtual environment is created on top of an existing Python installation, known as the virtual environment’s “base” Python, and may optionally be isolated from the packages in the base environment, so only those explicitly installed in the virtual environment are available.
Fedora CoreOS is another container operating system, with minimal operating system for running containerized workloads securely and at scale. It’s designed for clusters but also operable standalone, optimized for Kubernetes but also great without it.
You can deploy CoreOS to the cloud, install in bare metal or even run as VM, but in this writing we’re gonna install CoreOS from live ISO. The live ISO installation method can be used for bare metal or virtual machine like VirtualBox or VMWare. Download the live ISO of Fedora CoreOS from https://fedoraproject.org/coreos/download/ or download with podman command:
podman run --security-opt label=disable --pull=always --rm -v .:/data -w /data \
quay.io/coreos/coreos-installer:release download -s stable -p metal -f iso
Burn the ISO to disk. You can use dd on Linux and macOS, or use Rufus in “DD Image” mode on Windows.
Change fedora-coreos-38.20230514.3.0-live.x86_64.iso in the if parameter to your downloaded ISO and the value of /dev/sda to your disk device.
To install Fedora CoreOS from live ISO, we need to produce an Ignition config. Ignition is a configuration file that runs only once during the first boot of the system. It can create users, partition disks, format filesystems, and write files before the userspace begins to boot.
In the previous post, I’ve written about playing the container operating system with openSUSE MicroOS, and now moving on using it as Docker runtime. MicroOS has a single purpose to do “just one job”, and it will be doing the same thing running as Docker runtime in my development machine and accessing it via Windows Subsystem for Linux (WSL).
It takes advantage of a client-server model. we need MicroOS installed on VirtualBox as a server and accessing it with openSUSE Leap distribution installed on WSL. When you execute a Docker command in WSL, Docker connects to the MicroOS server via SSH.
At the end of this writing, we’d play acting like a WordPress developer who builds plugins and themes for WordPress with simplest way.
Let’s begin! We need openSUSE Leap 15.4 from WSL distribution. If you don’t have it, install with this command in Command Prompt:
Debian 11 allows installing PHP 7.4, but the latest Laravel (at the time of this writing is version 10) has as a requirement to have a PHP version equal to or higher than 8.1. We will use the DPA (Debian Package Archive) available at https://deb.sury.org/, since the official version is not so updated.
At the time of this writing, the latest openSUSE Leap 15.4 ships with PHP version 7.4 and 8.0. Likewise the upcoming release Leap 15.5 also including the PHP version 8.0. The latest popular PHP frameworks like Laravel (version 10) and Symfony (version 6.2), require minimal version 8.1, so we need to add the additional repository that packages PHP version 8.1.
If you have installed the PHP packages in your system, you have to execute the dup command in zypper. Like in my case that PHP 8.0 packages have been installed in the system, so I execute the following command:
When we run containers in production, basically we only need a Linux kernel, a host security mechanism and a container manager. It means actually we don’t need the complete Linux distribution. That’s the reason why the container operating system exists.
OpenSUSE MicroOS is an operating system that’s focused on running the containerized workloads. Although, MicroOS is not alone out there, you might hear about CoreOS (now part of Red Hat / Fedora), one of the first popular systems of this kind. But in this post, we’ll focus talking about openSUSE MicroOS.
Since Ubuntu 20.04, Snap becomes the default underlying method replacing the standard DEB in the Software Center, and the latest Ubuntu LTS release (22.04 Jammy Jellyfish) being pushed as new default package manager replacing the apt package manager, we used for years. For example, when you install the fresh installation of Ubuntu 22.04, you’ll find Firefox installed as Snap.
The problem is, when Snap is broken, in this specific case of Firefox as Snap, you can’t open your browser, you can’t browse the Internet or find any solution on the Internet when you got a trouble. There are known stability issues that simply don’t happen with traditional .deb packages, such as slower performance and due to its design, the application installation size is huge and costs disk space because it packages all the dependencies.
I bought the .my.id domain for less than $1 per year and hosted it for web blogging or profile website but don’t need to add new email inbox. With email routing features in CloudFlare, I can create custom email addresses for my purchased domains. For another reason, you may not want to share your private email for every newsletter or business.