Signed-off-by: karylab <blisseyblisseyblissey@gmail.com>
This commit is contained in:
@@ -3,10 +3,24 @@ on: [push]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-check:
|
test-check:
|
||||||
runs-on: ubuntu-latest # 確保這跟你在方法 1 看到的 Labels 其中一個對應
|
runs-on: ubuntu-latest
|
||||||
|
# 手動指定容器連線資訊
|
||||||
|
container:
|
||||||
|
image: ubuntu:latest
|
||||||
|
# 強制讓這個 Job 加入 gitea 的網路 (請替換成你的真實網路名)
|
||||||
|
options: --network gitea_gitea-net
|
||||||
|
|
||||||
|
# 手動設定環境變數
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: tcp://docker:2375
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Say Hello
|
- name: Say Hello
|
||||||
run: echo "Runner 活著!現在時間 $(date)"
|
run: echo "Testing connection..."
|
||||||
|
|
||||||
|
- name: Install Docker CLI (因為 ubuntu 映像檔預設沒有 docker)
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y docker.io
|
||||||
|
|
||||||
- name: Test Docker Access
|
- name: Test Docker Access
|
||||||
run: docker ps # 測試能不能呼叫 DinD
|
run: docker ps
|
||||||
Reference in New Issue
Block a user