gnu-on-alpine

Overview

The gnu-on-alpine Docker container consists of Alpine Linux, along with various GNU tools commonly used for shell scripting. This container is very closely related to alpine-plus-plus. The difference is that alpine-plus-plus includes git, while gnu-on-alpine does not. Thus, if you need git, choose alpine-plus-plus; and otherwise choose gnu-on-alpine. The base Docker image is the official Alpine Docker image, which was chosen for its small size. On top of Alpine is a single layer that includes the following GNU tools:

The original motivating use-case is for developing GitHub container actions. GitHub Actions is GitHub's CI/CD platform. GitHub Actions workflows are comprised of individual steps that can invoke Actions that perform a variety of functions. One of the ways to implement an Action is what GitHub calls a container action. This allows for implementing a GitHub Action using any programming languages or tools. In some cases, shell scripting may be sufficient. Thus, this container. It is certainly not limited to usage in GitHub Action development, and can be used for shell scripting tasks you need to execute locally, etc.

The gnu-on-alpine container can be pulled from Docker Hub as well as the GitHub Container Registry. When using gnu-on-alpine 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.

The developers of gnu-on-alpine are not affiliated with any of Alpine Linux, Docker, GNU, or GitHub. We simply use GitHub Actions, and developed this container to help others.

Docker Tags

The Docker tags of the container mirror the Docker tags of the underlying version of Alpine, which follows Semantic Versioning (SemVer). SemVer uses version numbers of the form: MAJOR.MINOR.PATCH, where differences in MAJOR correspond to incompatible changes, differences in MINOR correspond to the introduction of backwards compatible new functionality, and PATCH corresponds to backwards compatible bug fixes. Each image pushed to Docker Hub and the Github Container Registry is tagged as follows:

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/gnu-on-alpine: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/gnu-on-alpine: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/gnu-on-alpine:latest

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

FROM ghcr.io/cicirello/gnu-on-alpine: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 gnu-on-alpine, 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. Since the base image is Alpine, this would include the licenses of the components of Alpine; and also includes the licenses of the GNU tools added to the image.

Impact on Licenses of Derivatives: If you build and distribute an image containing your software, using gnu-on-alpine as the base image, it is your responsibility to follow the licenses of all of the software contained within the image. At the time of this writing, one of the effects of the combination of those licenses is a constraint on the licensing of such a pre-built image containing your software to the GPL 3.0 or later (derived from the inclusion of bash and the other GNU tools). If you desire a more permissive license for your software, one approach would be to instead distribute a Dockerfile that builds the image containing your software, rather than a pre-built image of your software, which should circumvent the issue since you would no longer be distributing a derivative of GPL licensed software.

Blog Posts About gnu-on-alpine

As the author of the gnu-on-alpine 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 gnu-on-alpine.