Docker prune as github action

Can I run docker prune images -a as a workflow’s step? I’m trying to do like this:

      -
        name: Login to DockerHub
        uses: docker/login-action@v1 
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Remove old images from Docker Hub
        run: docker image prune -a

I know there’s a bunch of old images on my repository but the output is:

Are you sure you want to continue? [y/N] Total reclaimed space: 0B

docker image prune works only on local images, not Docker Hub or any other container registry. I assume there simply isn’t any unused image on the runner.

I’m not sure what’s the recommended way to clean up on Docker Hub, the registry API was kind of low level the last time I checked. :sweat_smile: