pyaction

Overview

The pyaction container is a Python slim image that includes all of the following pre-installed: git, the GitHub CLI, gpg and curl. The motivating use-case is developing GitHub Actions in the Python language, which is the origin of why this container includes Python, git, and the GitHub CLI. Installing the GitHub CLI requires gpg and curl, which is why these are also in the container. Since they may also be useful in implementing some actions, our container build process does not uninstall them. The pyaction container can be pulled from Docker Hub as well as the GitHub Container Registry. When using pyaction in the development of a GitHub Container Action, we recommend pulling from the GitHub Container Registry, as it is likely faster for that use-case. It is certainly not limited to GitHub Action development, and can be used for any other use-case where having the GitHub CLI running in a Docker container is desirable.

GitHub Actions Built With pyaction

The pyaction container serves as a foundation for several of our GitHub Actions. These include the following (each linked to a page with more detail):

Docker Tags

For the current version of Python (e.g., 3.13.5) and current version of GitHub CLI (e.g., 2.76.2), all of the following tags are available and equivalent: latest, 3.13.5, 3.13, 3.13.5-gh-2.76.2, 3.13.5-gh-2.76, 3.13.5-gh-2, 3.13-gh-2.76.2, 3.13-gh-2.76, 3.13-gh-2.

For prior versions of Python (3.8, 3.9, 3.10, 3.11, 3.12) and current version of GitHub CLI (2.76.2), all of the following tags are available and equivalent: 3.12, 3.12-gh-2.76.2, 3.12-gh-2.76, 3.12-gh-2.

This tag scheme began with version 2.75.0 of the GitHub CLI. We don't support pyaction images with earlier versions of the GitHub CLI.

This tag scheme began with Python 3.13.5. Python patch level tags are not available for pyaction prior to Python 3.13.5.

Usage

The pre-built image is hosted on both Docker Hub and the Github Container Registry. You can use it in the following ways.

Latest release on Docker Hub

Docker Pull: Pull the latest image from Docker Hub with the following (replace latest with a specific version number if you prefer):

docker pull cicirello/pyaction:latest

Base Image in a Dockerfile: Use as a base image in a Dockerfile (replace latest with a specific version number if you prefer):

FROM cicirello/pyaction:latest
# The rest of your Dockerfile would go here.
Latest release in the GitHub Container Registry

Docker Pull: Pull from the Github Container Registry with:

docker pull ghcr.io/cicirello/pyaction:latest

Base Image in a Dockerfile: Use as a base image in a Dockerfile (via the Github Container Registry) with:

FROM ghcr.io/cicirello/pyaction:latest
# The rest of your Dockerfile would go here.

License

Source Code License: The source code, including the Dockerfile and anything else within the Github repository for pyaction, is licensed under the MIT License.

Image Licenses: As with all pre-built Docker images, the image itself (once built, or obtained from Docker Hub or the Github Container Registry) contains software that is covered by a variety of licenses. See the license information for the python docker image, the license for git, the license for GitHub CLI, and the license for Python.

Blog Posts About pyaction

As the author of the pyaction Docker Container, I occasionally post about this, and other software that I maintain on DEV.to. See my DEV.to profile for a full list of such posts. Below is a selection of blog posts specifically about pyaction.