5

What is the official / recommended way to install Docker on GitHub Actions?

In particular I need to run a custom script on GitHub Actions that, among other tasks, calls docker build and docker push.

I don't want pre-made actions that build/push, I want to have access to the docker command.

What should I do?

The only official action that I can find uses Docker Buildx and not the normal docker: https://github.com/marketplace/actions/build-and-push-docker-images

Beside that I can find this action (https://github.com/marketplace/actions/setup-docker) but I don't know if I can trust that source, since it's not official.

Any recommendations? How do you install the docker command on GitHub Actions?

collimarco
  • 34,231
  • 36
  • 108
  • 142
  • 7
    It seems Docker is already installed on the Github Runners ([you can see it here for ubuntu-latest](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#tools)). I performed a test just running `docker --version` without any setup and it returned `Docker version 20.10.14+azure-1, build a224086349269551becacce16e5842ceeb2a98d6` as you can see [in this workflow run](https://github.com/GuillaumeFalourd/poc-github-actions/runs/6240357495?check_suite_focus=true) – GuiFalourd Apr 30 '22 at 13:38

0 Answers0