Skip to content

Appends docker buildx nodes to an already setup buildex builder

License

Notifications You must be signed in to change notification settings

baschny/append-buildx-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

baschny/append-buildx-action

This is a GitHub Action that allows to append external builders to the docker buildx. This is meant to be called after setup-buildx-action.

Useful if you want to create cross-platform images and do not want to use the slow QEMU approach which is used by default if there are not external builders configured.

With this "add-on" you can attach for example an external (i.e. AWS hosted) ARM instance or use a Kubernetes cluster.

Input

  • builder: The builder name from the previous step.
  • platform: For what platform to add the new node (defaults to linux/arm64)
  • node_name: The name of the new node (defaults to arm)
  • driver_opt: Some --driver-opt settings, for example nodeselector=kubernetes.io/arch=arm64
  • endpoint: An endpoint/context for this node, i.e. ssh://[email protected]
  • ssh_private_key: If using an ssh:// endpoint, make sure you set a secret in your repository containing the private SSH key. You need SSH access to this docker machine with its corresponding public key.

Example Workflow

name: Build cross platform docker images

on: [push]

jobs:

  build:
    runs-on: ubuntu-latest

    steps:
      - name: "Checkout repository"
        uses: actions/checkout@v2
      
      - name: "Set up Docker Buildx"
        id: builder
        uses: docker/setup-buildx-action@v1

      - name: "Append ARM buildx builder from AWS"
        uses: baschny/append-buildx-action@v1
        with:
          builder: ${{ steps.builder.outputs.name }}
          endpoint: "ssh://[email protected]"
          ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

Troubleshooting

Issue: Cannot Connect to Docker Daemon

If you encounter the error:

ERROR: Cannot connect to the Docker daemon at http://docker.example.com. Is the docker daemon running?

This is typically a permission issue. To resolve it, follow these steps on your server:

  1. Add Docker Group: Create a Docker group, if it doesn't exist:

    sudo groupadd docker
  2. Add User to Docker Group: Grant Docker permissions to your user:

    sudo usermod -aG docker $USER
  3. Re-login: Log out and back in to apply these changes.

For detailed information, refer to Docker's post-installation steps for Linux: Docker Documentation.

License

See LICENSE file.

See also

The idea came while waiting for this feature request: docker/setup-buildx-action#115.

Author

Ernesto Baschny, cron IT GmbH

About

Appends docker buildx nodes to an already setup buildex builder

Resources

License

Stars

Watchers

Forks

Packages

No packages published