Home > Enterprise >  Use docker-hub-image in Github actions running on Github-hosted runners
Use docker-hub-image in Github actions running on Github-hosted runners

Time:06-20

Do the Github-hosted runners support direct use of specific docker images available on docker hub?

For example, using the docker image "aergus/latex" on a self-hosted Gitlab-runner is easy as:

job_name:
    image: "aergus/latex"

Is it possible to do something similar on Github-hosted runners? I.e., instead of using "ubuntu-lastest" or "windows-latest", directly specify a docker image?

CodePudding user response:

You can run a job in a container like so:

jobs:
  myjob:
    runs-on: ubuntu-latest
    container:
      image: node:14.16
    steps:
      - run: uname

Note that the runner must be ubuntu.

  • Related