Add .gitea/workflows/test-dind.yaml
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
name: Test DinD Capabilities
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
workflow_dispatch: # Allows manual trigger from Gitea UI
|
||||
|
||||
jobs:
|
||||
test-dind:
|
||||
runs-on: ubuntu-latest # Change to your runner tag if customized
|
||||
|
||||
# If your runner uses docker-container execution mode without automatic DinD sidecars,
|
||||
# you can uncomment the service below:
|
||||
# services:
|
||||
# docker:
|
||||
# image: docker:dind
|
||||
# privileged: true
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Verify Docker CLI Availability
|
||||
run: |
|
||||
docker version
|
||||
docker info
|
||||
|
||||
- name: Test Running a Container (Docker Pull & Run)
|
||||
run: |
|
||||
echo "Testing basic container execution..."
|
||||
docker run --rm alpine:latest echo "DinD works: Container successfully executed!"
|
||||
|
||||
- name: Test Building an Image
|
||||
run: |
|
||||
echo "Testing docker build..."
|
||||
echo "FROM alpine:latest" > Dockerfile
|
||||
echo "RUN echo 'Built inside DinD' > /test.txt" >> Dockerfile
|
||||
echo "CMD cat /test.txt" >> Dockerfile
|
||||
|
||||
docker build -t test-dind-image:local .
|
||||
docker run --rm test-dind-image:local
|
||||
Reference in New Issue
Block a user