Can we run github actions inside a docker container?



  • Is it possible to run github actions inside docker container like jenkins?



  • There are two aspects:

    1. can github actions run containers?
    2. Can github actions run container like jenkins

    To answer the former, by default Github actions do run in containers. From the https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#the-components-of-github-actions :

    Your workflow contains one or more jobs which can run in sequential order or in parallel. Each job will run inside its own virtual machine runner, or inside a container, and has one or more steps that either run a script that you define or run an action, which is a reusable extension that can simplify your workflow.

    (emphasis my own)

    There is also a https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action

    For the latter part of the question, it's not quite clear what you mean by "like Jenkins", but the https://docs.github.com/en/actions/migrating-to-github-actions/migrating-from-jenkins-to-github-actions should provide the relevant context.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2