Skip to content

Commit c2ba493

Browse files
Enable github/workflow to verify Dockerfile. (#5035) (#5037)
Signed-off-by: Tomoya Fujita <[email protected]> (cherry picked from commit 175e677) Co-authored-by: Tomoya Fujita <[email protected]>
1 parent de7c7ed commit c2ba493

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build & Run Docker Image
2+
3+
on:
4+
pull_request:
5+
# Only kick workflow if docker files or this workflow are changed
6+
paths:
7+
- 'docker/**'
8+
- '.github/workflows/docker-image.yml'
9+
10+
jobs:
11+
validate:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Fetch full history including branches and tags
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Build Docker image
23+
run: docker build --rm --build-arg user=$(id -un) --build-arg uid=$(id -u) -f ./docker/image/Dockerfile -t test-image:latest .
24+
25+
- name: Run container and verify
26+
run: |
27+
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/tmp/doc_repository test-image:latest

0 commit comments

Comments
 (0)