Esiste una relazione tra il volume di montaggio con il comando docker run -v
e l'istruzione VOLUME
di Dockerfile?docker run -v <dir> vs Dockerfile's VOLUME <dir>
5
A
risposta
4
L'opzione -v
può essere utilizzata per associare una directory sull'host al contenitore, ma l'istruzione VOLUME
non può. Oltre a questo sono due modi diversi per rendere disponibile un volume nel contenitore.
Entrambe le istruzioni creano un punto di montaggio nel contenitore, ma solo -v
può effettivamente montare qualsiasi cosa lì.
Vedi:
http://docs.docker.com/engine/reference/builder/#volume e
http://docs.docker.com/engine/userguide/dockervolumes/#mount-a-host-directory-as-a-data-volume
per più descrizioni approfondite di ciò che entrambi fanno.
Problemi correlati
- 1. Docker-Compose: Initialize vs Run
- 2. Docker run vs create
- 3. Differenza tra codice byte. <init>() V vs. <init> (Z) V
- 4. Converti Set <Map.Entry <K, V>> a HashMap <K, V>
- 5. esecuzione docker <IMAGE><COMANDI MULTIPLI>
- 6. TextBlock con più <Run> spaziatura
- 7. PHP: <<< vs ob_start
- 8. Impossibile trasmettere .Net ConcurrentDictionary <K,V> all'interfaccia IReadOnlyDictionary <K,V>?
- 9. Perché la mappa <K,V> non estende la funzione <K,V>?
- 10. GameObject.FindObjectOfType <>() vs GetComponent <>()
- 11. Rails ERB <%- ... -%> vs. <% ... %>
- 12. python -c vs Python - << heredoc
- 13. <cstdint> vs <stdint.h>
- 14. <applet> vs <object>
- 15. eseguire "docker run" da crontab
- 16. cat ... vs ... <file
- 17. Rails Erb migliori pratiche (<% %> vs <% -%> vs <%- -%>)
- 18. XSD formattazione <element><complexType> vs <complexType /><element/>
- 19. Docker compose - share volume Nginx
- 20. Il volume denominato Docker non si aggiorna
- 21. Montare il volume sull'immagine Docker su OSX
- 22. "<>" vs "NOT IN"
- 23. Vector. <> Vs array
- 24. GIT i file corrotti (<<<<<<<< testa)
- 25. coda <T> vs Lista <T>
- 26. Mock.Of <Object> VS Mock <Object>()
- 27. Lista <?> vs Lista <? si estende Oggetto>
- 28. Lista <T> .AsReadOnly() vs IReadOnlyCollection <T>
- 29. Edera: <ivy: settings> vs. <ivy: configure>
- 30. document.write ('<scr' + 'ipt src = vs <script src =