mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 01:10:12 -08:00
pull the image before starting the instance
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
function run_io () {
|
||||
docker run -d -p 9001:9001 --name=${image_name} --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/${portainer_image}
|
||||
|
||||
docker run -d -p 9001:9001 --name=${image_name} --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes /${portainer_image}
|
||||
}
|
||||
|
||||
function run_vperanda () {
|
||||
docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name=${image_name} --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/${portainer_image}
|
||||
docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name=${image_name} --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data ${portainer_image}
|
||||
}
|
||||
|
||||
portainer_image=""
|
||||
@@ -14,11 +13,11 @@ image_name=""
|
||||
|
||||
case ${HOSTNAME} in
|
||||
vperanda)
|
||||
portainer_image="portainer-ee:latest"
|
||||
portainer_image="portainer/portainer-ee:latest"
|
||||
image_name="portainer"
|
||||
;;
|
||||
io)
|
||||
portainer_image="agent:latest"
|
||||
portainer_image="portainer/agent:latest"
|
||||
image_name="portainer_agent"
|
||||
;;
|
||||
esac
|
||||
@@ -27,7 +26,10 @@ esac
|
||||
docker stop ${image_name}
|
||||
docker rm ${image_name}
|
||||
|
||||
# run the command to pull and run the latest [portainer,portainer-edge] docker image
|
||||
# pull the latest image
|
||||
docker pull ${portainer_image}
|
||||
|
||||
# run the command run the latest [portainer,portainer-agent] docker image
|
||||
case ${HOSTNAME} in
|
||||
vperanda)
|
||||
run_vperanda
|
||||
|
||||
Reference in New Issue
Block a user