- 新建docker-start.bat文件
@echo off
REM Set the name of the VM configuration where dockerd will be hosted
set BOOT2DOCKER_VM=default
set PATH=%PATH%;"D:\Docker Toolbox\"
REM Start the default machine (or any other machine)
docker-machine start %BOOT2DOCKER_VM%
REM docker-compose up or docker run
docker start redis mysql
cmd
也可以使用docker-compose来启动容器,这里使用了docker start
- 将bat 放入
C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
文件夹,即可开机执行bat文件