简体   繁体   中英

Need to run a docker image in azure virtual machine scale sets

I have a docker image, I want to run it in azure VMSS. It should be scaled automatically (custom scaling based on metrics). Need some help on how to achieve this..

I can create a VM, install docker and run docker image there. But not sure how to do the same in VMSS. Do we need to get into the instances of VMSS and install docker and run docker image there in each VM? If so, how it will work when it scaled out to new instances..

I wish I had a reliable answer. I created the base VM, modified /etc/docker/daemon.json so it sets data-root to run in /mnt/docker, which would have tons of space.

tested out docker there using docker version 20.10.12. docker pull worked, docker run, ps -a, docker rm, docker image ls, docker system prune, all worked.

generalized vm, created image, hosted it in compute gallery, built a VMSS from the image version in the compute gallery. Logged into a running instance. successfully did a docker pull. but on docker run (same command I used in base VM), and poof, kernel panic, not syncing error.

but then, later on, after googling around (some said out-of-diskspace (not the problem)), found this site, tried to reproduce, and poof, it worked, docker run worked. I changed nothing.

Which kinda sucks. I built the VMSS for Azure Devops build/release pipelines. having it sometimes work (or fail the first time, dunno yet) is not a good solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM