1、共享文件夹
http://www.kaotop.com/it/176615.html
将共享的文件夹放入docker-machine当前工作目录下
2、使用dockerfile构建镜像(创建类)
FROM ubuntu
ENV LANG C.UTF-8
WORKDIR /home
RUN cd /home
RUN mkdir project
RUN apt-get update
RUN apt-get install vim -y
EXPOSE 5000
CMD /bin/bash
最后有个 .
docker build -f dockerfile所在路径 -t myubuntu .
3、实例化容器(实例化对象)
docker run -it -v /masterdir:/home/project -p 5000:5000 myubuntu /bin/bash
4 、启动mysql docker
创建镜像
https://blog.csdn.net/xsj34567/article/details/80940238?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-80940238-blog-122918522.pc_relevant_antiscanv3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-80940238-blog-122918522.pc_relevant_antiscanv3&utm_relevant_index=2
启动docker
docker run -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 mysql镜像名