Recommand · October 22, 2021 0

Github Action running container with options

In docs there is described how to run container with additional options: Workflow syntax for GitHub Actions – GitHub Docs

jobs:
  build:
    name: Container with name
    runs-on: ubuntu-latest
    container: 
      image: ghcr.io/repo/image:latest
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --name="myContainerName" # or --name myContainerName

But snippet above create and start docker without name argument… and of course other argument doesn’t work, like --workdir.

Name of container is generated like this: 31ec555a1aav41a5bffe95da6f8b775b_ghcriorepoimage10_c998dc