/ghaction-setup-containerd

GitHub Action to set up containerd

Primary LanguageTypeScriptMIT LicenseMIT

GitHub release GitHub marketplace Test workflow Codecov Become a sponsor Paypal Donate

About

GitHub Action to set up containerd.


Usage

Quick start

name: containerd

on:
  push:

jobs:
  containerd:
    runs-on: ubuntu-latest
    steps:
      -
        name: Set up containerd
        uses: crazy-max/ghaction-setup-containerd@v3

Pull Docker image

name: containerd

on:
  push:

jobs:
  containerd:
    runs-on: ubuntu-latest
    steps:
      -
        name: Set up containerd
        uses: crazy-max/ghaction-setup-containerd@v3
      -
        name: Pull Docker image
        run: |
          sudo ctr i pull --all-platforms --all-metadata docker.io/crazymax/diun:latest

Build and push Docker image

name: containerd

on:
  push:

jobs:
  containerd:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v4
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      -
        name: Set up containerd
        uses: crazy-max/ghaction-setup-containerd@v3
      -
        name: Build Docker image
        uses: docker/build-push-action@v4
        with:
          context: .
          file: ./Dockerfile
          platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
          tags: docker.io/crazymax/diun:latest
          outputs: type=oci,dest=/tmp/image.tar
      -
        name: Import image in containerd
        run: |
          sudo ctr i import --base-name docker.io/crazymax/diun --digests --all-platforms /tmp/image.tar
      -
        name: Push image with containerd
        run: |
          sudo ctr i push --user "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" docker.io/crazymax/diun:latest

Customizing

inputs

The following inputs can be used as step.with keys

Name Type Default Description
containerd-version String latest containerd version (e.g., v1.4.1)
config String Containerd config file
config-inline String Same as config but inline

config and config-inline are mutually exclusive.

Limitation

This action is only available for Linux virtual environments.

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by becoming a sponsor on GitHub or by making a PayPal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.