Cum să montezi volume Docker în Drone CI
DodaTech
Updated 2025-01-15
1 min read
In this tutorial, you'll learn about Cum să montezi volume Docker în Drone CI. We cover key concepts, practical examples, and best practices.
Montarea volumelor în Drone CI permite partajarea datelor între pași și persistarea fișierelor generate.
Volume de bază
kind: pipeline
type: docker
name: volumes
steps:
- name: generate
image: alpine
commands:
- echo "data" > /shared/output.txt
- name: read
image: alpine
commands:
- cat /shared/output.txt
volumes:
- name: shared
temp: {}
Volume host
steps:
- name: build
image: golang:1.20
volumes:
- name: cache
path: /go/pkg/mod
commands:
- go build
volumes:
- name: cache
host:
path: /tmp/gomod-cache
Volume pentru Docker-in-Docker
steps:
- name: docker
image: docker:dind
volumes:
- name: docker-socket
path: /var/run/docker.sock
commands:
- docker build -t app .
volumes:
- name: docker-socket
host:
path: /var/run/docker.sock
Volume multiple
volumes:
- name: shared
temp: {}
- name: cache
host:
path: /tmp/cache
- name: config
host:
path: /etc/app/config
Prevenire
- Folosește volume temporare pentru date izolate
- Verifică permisiunile pentru volumele host
- Nu monta directoare sensibile
DodaTech Tools
Doda Browser monitorizează volumele montate. DodaZIP arhivează conținutul volumelor temporare.
Întrebări frecvente
Construit de echipa Doda Browser, DodaZIP și Durga Antivirus Pro.
← Previous
Cum să rulezi build-uri de deploy în Drone CI
Next →
Cum să rulezi containere privilegiate în Drone CI
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro