I have just started experimenting with the CI/CD functionality of GitHub Actions, and I fail to understand the “runs-on” and “container” options.
Why both “runs-on” and “container” are required when I want to run a container, and what exactly does this mean? Let’s say for example that I have “runs-on: ubuntu-latest” and “container: centos-latest”. Does this mean that my requested centos-latest image will run on an ubuntu-latest virtual machine? Why do I even have to specify the host operating system (ubuntu-latest) if I plan to use a container and do everything I want to do there?
If I try “runs-on: macos-latest” and “container: centos-latest”, at the job setup I get the following error: “##[error]File not found: ‘docker’”, which make sense because MacOS can’t run Docker. But why is there an option to have a CI configuration file like this?
What if someone wants to create a build matrix with different containers? To my understanding this is not possible at the moments because the build matrix somehow works only with the “runs-on” option.
Wouldn’t it be better if there was no “container” option, and instead one would have to specify the docker image on the “runs-on” option?
Please excuse me if I am getting something totally the wrong way… I started experimenting with CI/CD only a couple of days ago.
Thanks in advance.