Skip to content
refresh-cw

GitHub Action

Docker Run

v2.2.1 Latest version

Docker Run

refresh-cw

Docker Run

Run steps using docker

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Docker Run

uses: tj-actions/[email protected]

Learn more about this action in tj-actions/docker-run

Choose a version

CI Update release version. Public workflows that use this action.

docker-run

GitHub action to run steps using docker

Examples

Using a locally built image

...
    steps:
      - uses: actions/checkout@v2

      - name: Set up QEMU
        uses: docker/[email protected]

      - name: Set up Docker Buildx
        uses: docker/[email protected]

      - name: Build
        uses: docker/build-push-action@v3
        with:
          context: .
          load: true
          push: false
          tags: user/app:latest
      
      - name: Run
        uses: tj-actions/docker-run@v2
        with:
          image: user/app:latest
          name: user-app
          args: |
            echo "Hello World"

Using an image from a registry

...
    steps:
      - uses: actions/checkout@v2
      
      - name: Run ubuntu from dockerhub
        uses: tj-actions/docker-run@v2
        with:
          image: ubuntu:latest  # OR gcr.io/cloud-builders/gradle
          name: ubuntu
          args: |
            echo "Hello World"

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
args string false Command to run
image string true Docker image
name string true Container name
options string false Options to pass to docker
run

Outputs

OUTPUT TYPE DESCRIPTION
container-id string Container ID

If you feel generous and want to show some extra appreciation:

Buy me a coffee

Credits

This package was created with Cookiecutter using cookiecutter-action

Report Bugs

Report bugs at https://github.com/tj-actions/docker-run/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.