コンテンツにスキップ

Docker Run

このコンテンツはまだ日本語訳がありません。

Run a Docker container from an image or Dockerfile.

Runs a Docker container directly without requiring a GitHub Action wrapper.

The image input uses the docker:// prefix convention (same as GitHub Actions):

Pull from registry (use docker:// prefix):

  • docker://hello-world
  • docker://alpine:latest
  • docker://ghcr.io/owner/image:tag
  • docker://docker.io/library/nginx

Build from Dockerfile (no prefix):

  • Dockerfile
  • ./Dockerfile
  • ./build/Dockerfile.prod
  • /absolute/path/to/Dockerfile
PortDescription
Image
Use docker:// prefix for registry images, or path for Dockerfile.
Registry: docker://alpine:latest, docker://ghcr.io/owner/image
Dockerfile: Dockerfile, ./build/Dockerfile.prod
Args
Arguments to pass to the container entrypoint.
Entrypoint
Override the image’s default entrypoint.
Example: ["/bin/sh", "-c"]
Working Directory
Working directory inside the container.
For GitHub workflows: defaults to /github/workspace (where the repo is mounted).
Otherwise: uses the image’s default WORKDIR.
Volumes
Volume mounts in the format host_path:container_path or host_path:container_path:ro for read-only.
Network
Docker network to connect the container to (e.g., host, bridge, or a custom network name).
Pull Policy
When to pull the image from the registry.
Mount Docker Socket
Mount the host’s Docker socket into the container, enabling Docker-in-Docker.
This matches GitHub Actions’ default behavior for container actions.
Disable if the container doesn’t need Docker access.
Environment Vars
Additional environment variables for the container.
Workflow/job environment variables are automatically included.
Use KEY=VALUE format to add or override variables.
PortDescription
Success
Error
Exit Code

ID: core/docker-run@v1