install and config docker toolbox in win10

(hyper-v can't work in my win10 system)

install docker toolbox(Download:https://www.docker.com/products/docker-toolbox)


(git bash)
docker-machine create --driver=virtualbox default                                                                                creating docker machine driving by virtualbox
docker-machine start default                                                                                                                 starting the docker machine named default
eval $(docker-machine env default)                                                                                                      for using docker command outside docker
docker-machine stop default                                                                                                                 stopping session of docker
"C:\Program Files\Oracle\VirtualBox\VBoxManage" sharedfolder add default -name win_share_a -hostpath c:/a/a                                        adding a sharefolder named win_share_a
docker-machine start default                                                           starting the docker machine named default


(cygwin)
ssh docker@192.168.99.101/tcuser (OR docker-machine ssh default in git bash)                               connecting to docker
cd /
sudo mkdir /c/a/a                                                                                                                                    creating a shared folder in docker vm(c:/Users is shared by default as /c/Users)
sudo mount -t vboxsf win_share_a /c/a/a                                                                                               mounting win_share_a into /c/a/a which is c:/a/a


(git bash)

create Dockerfile

docker build -t test/a .                                                                                                                              building an image named test/a using Dockerfile

docker run --rm -v //c//a//a://data -w //data test/a ls                                                                                 mounting /c/a/a into /data of container named test/a and show the content under /data

docker-compose run ...


参考链接:

http://www.jianshu.com/p/6a354fead698

https://blog.harbur.io/how-to-start-with-docker-3fd95eed8898

http://ju.outofmemory.cn/entry/287017

https://segmentfault.com/q/1010000004674939

https://stackoverflow.com/questions/30864466/whats-the-best-way-to-share-files-from-windows-to-boot2docker-vm

https://github.com/moby/moby/issues/12673

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值