0
votes

how to Automatically start a container when Windows PC start?(Iam using Docker Quickstart Terminal, DockerToolbox-19.03.1.exe) I found the Jenkins container is not automatically start when the PC start, every time I have to open Docker Quickstart Terminal manually and then type "docker container run --name jenkins-blueocean --rm --detach --network jenkins --env DOCKER_HOST=tcp://docker:2376 --env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 --volume jenkins-data:/var/jenkins_home --volume jenkins-docker-certs:/certs/client:ro --publish 1122:8080 --publish 50000:50000 jenkinsci/blueocean"

1
I have never run docker on windows but on Linux and Mac there is an option for Restart Policy. Do check that out :)Faisal

1 Answers

0
votes

I don't use docker on windows, so sorry if this work-around is not useful !

You can make a .bat script that runs the command at startup ( task scheduler should have the option as you might want to wait for Docker to finish loading ).

Here is a level 0 tutorial that also shows how to setup a task at startup.