No description
This repository has been archived on 2024-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Abdud Dayan Adeeb 27808d9e5f
Update README.md
2021-01-09 15:29:20 -05:00
.gitignore setup docker run action 2020-06-17 18:47:31 -04:00
action.yml run on specific shell 2020-06-17 21:21:47 -04:00
Dockerfile fix command 2020-06-17 19:03:19 -04:00
entrypoint.sh fix: exposing docker socket for DinD 2020-06-24 15:16:56 -04:00
LICENSE Initial commit 2020-06-17 17:53:48 -04:00
README.md Update README.md 2021-01-09 15:29:20 -05:00

Docker Run Action

Github Workflows already supports running on public docker images out-of-the-box (See jobs.<jobs_id>.container).

Then why use docker-run-action?

  • run on a privately-owned image.
  • run on an image built by a previous step.
  • run a specific step in docker

Example Usage

single-line command

- uses: addnab/docker-run-action@v1
  with:
    image: docker:latest
    run: echo "hello world"

multi-line commands

- uses: addnab/docker-run-action@v1
  with:
    image: docker:latest
    run: |
      echo "first line"
      echo "second line"      

run on a privately-owned image

- uses: addnab/docker-run-action@v1
  with:
    username: ${{ secrets.DOCKER_USERNAME }}
    password: ${{ secrets.DOCKER_PASSWORD }}
    registry: gcr.io
    image: test-image:latest
    run: echo "hello world"

run on an image built by a previous step

- uses: docker/build-push-action@v1
  with:
    repository: test-image
    push: false
- uses: addnab/docker-run-action@v1
  with:
    image: test-image:latest
    run: echo "hello world"

use a specific shell (default: sh).

Note: The shell must be installed in the container

- uses: addnab/docker-run-action@v1
  with:
    image: docker:latest
    shell: bash
    run: |
      echo "first line"
      echo "second line"      

use docker options

- uses: addnab/docker-run-action@v1
  with:
    image: docker:latest
    options: -v $GITHUB_WORKSPACE:/work -e ABC=123
    run: |
      echo "first line"