- Run a specific step in docker.
- Run an image built by a previous step.
To use the GitHub Action, add the following to your job:
- uses: conventional-actions/docker-run@v1
with:
image: myrepo/mydocker:latest
Name | Default | Description |
---|---|---|
image |
required | Docker image |
options |
N/A | Docker options |
entrypoint |
N/A | Container entrypoint |
command |
N/A | Run command in the container |
shell |
N/A | Use a specific shell |
run |
N/A | Run command in container |
network |
${{ job.container.network }} |
Docker Network to use |
No outputs
- name: Checkout
uses: actions/checkout@v2 # Required to mount the Github Workspace to a volume
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: conventional-actions/docker-run@v1
with:
image: private-image:latest
options: -v ${{ github.workspace }}:/work -e ABC=123
command: mycommand
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: conventional-actions/docker-run@v1
with:
image: test-image:latest
run: echo "hello world"
- uses: docker/build-push-action@v2
with:
tags: test-image:latest
push: false
- uses: conventional-actions/docker-run@v1
with:
image: test-image:latest
run: echo "hello world"
Note: The shell must be installed in the container
- uses: conventional-actions/docker-run@v1
with:
image: docker:latest
shell: /bin/bash
run: |
echo "first line"
echo "second line"
The scripts and documentation in this project are released under the MIT License.