From 287eb692661e08a83b73c9bac025b92139b993db Mon Sep 17 00:00:00 2001 From: icechen Date: Tue, 4 Jan 2022 20:38:35 +0800 Subject: [PATCH] fix: use host docker --- .../go_handler_template/go_api_production_pipeline.go | 8 ++++++++ go_handler/go_handler_template/go_api_test_pipeline.go | 8 ++++++++ .../go_handler_template/go_service_production_pipeline.go | 8 ++++++++ .../go_handler_template/go_service_test_pipeline.go | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/go_handler/go_handler_template/go_api_production_pipeline.go b/go_handler/go_handler_template/go_api_production_pipeline.go index e4187f4..ffb945b 100644 --- a/go_handler/go_handler_template/go_api_production_pipeline.go +++ b/go_handler/go_handler_template/go_api_production_pipeline.go @@ -8,6 +8,9 @@ name: 部署production-api-{{ .Name }} steps: - name: build image: plugins/docker + volumes: + - name: docker + path: /var/run/docker.sock settings: username: from_secret: reg_username @@ -41,4 +44,9 @@ steps: - port={{ .Port }} - host=t{{ .Host }} - path={{ .Path }} + +volumes: + - name: docker + host: + path: /var/run/docker.sock ` diff --git a/go_handler/go_handler_template/go_api_test_pipeline.go b/go_handler/go_handler_template/go_api_test_pipeline.go index b1e8f41..38a196a 100644 --- a/go_handler/go_handler_template/go_api_test_pipeline.go +++ b/go_handler/go_handler_template/go_api_test_pipeline.go @@ -8,6 +8,9 @@ name: 部署test-api-{{ .Name }} steps: - name: build image: plugins/docker + volumes: + - name: docker + path: /var/run/docker.sock settings: username: from_secret: reg_username @@ -41,4 +44,9 @@ steps: - port={{ .Port }} - host=t{{ .Host }} - path={{ .Path }} + +volumes: + - name: docker + host: + path: /var/run/docker.sock ` diff --git a/go_handler/go_handler_template/go_service_production_pipeline.go b/go_handler/go_handler_template/go_service_production_pipeline.go index 0b8c669..2b8a5a3 100644 --- a/go_handler/go_handler_template/go_service_production_pipeline.go +++ b/go_handler/go_handler_template/go_service_production_pipeline.go @@ -8,6 +8,9 @@ name: 部署production-service-{{ .Name }} steps: - name: build image: plugins/docker + volumes: + - name: docker + path: /var/run/docker.sock settings: username: from_secret: reg_username @@ -39,4 +42,9 @@ steps: - image=reg.icechen.cn/{{ .NameSpace }}/service-{{ .Name }} - imageTag=${DRONE_TAG} - port={{ .Port }} + +volumes: + - name: docker + host: + path: /var/run/docker.sock ` diff --git a/go_handler/go_handler_template/go_service_test_pipeline.go b/go_handler/go_handler_template/go_service_test_pipeline.go index e9146fe..66bec98 100644 --- a/go_handler/go_handler_template/go_service_test_pipeline.go +++ b/go_handler/go_handler_template/go_service_test_pipeline.go @@ -8,6 +8,9 @@ name: 部署test-service-{{ .Name }} steps: - name: build image: plugins/docker + volumes: + - name: docker + path: /var/run/docker.sock settings: username: from_secret: reg_username @@ -39,4 +42,9 @@ steps: - image=reg.icechen.cn/{{ .NameSpace }}/service-{{ .Name }} - imageTag=${DRONE_COMMIT:0:8} - port={{ .Port }} + +volumes: + - name: docker + host: + path: /var/run/docker.sock `