Shared Volume in Docker through Vagrant

前端 未结 3 1413
独厮守ぢ
独厮守ぢ 2021-02-06 02:13

I have a Vagrant virtualbox which hosts a Docker container. The host machine has a folder which needs to be accessible in the vm and the container:

Host: /host/p         


        
3条回答
  •  渐次进展
    2021-02-06 02:59

    I had the same issues. The posted solutions didn't fit my requirements.

    Here is my solution. If you run more than one container iterate over the cids in /var/lib/vagrant/cids/

    The first script disables the docker-deamon container autostart at boot. The second script starts the container by its CID only if it isn't running.

    This is working for the initial vagrant up and following vagrant [ up | reload ] --provision

    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    
    $disableAutostart = <
    
                                     
                  
提交回复
热议问题