How can I tell a machine to restart with a new version of an image (with the same tag).

Lets say my machine is configured to use a docker image nick/test:v1 and then I push an updated version of that docker image with the same tag (v1). If I tell the machine to restart, will it automatically pull the new version of the image?

Do I need to create a new machine and then delete the old one?

Any help is appreciated!

Hi Nick,

If you push an updated version of a Docker image with the same tag, the machine won’t automatically pull the new version of the image when you restart the machine.
Instead of using the same tag, you can tag the new version of the Docker image with a new tag, and then update the configuration to use the new tag.

Hey @devanshvarshney is correct - pushing the image and rebooting won’t necessarily wind up with the updated image.

May I ask, @nick-brevity, how are you building and pushing your image? We do have some things that let you deploy with a dockerfile in your project directory, then you don’t have to increment tags manually, and update machines yourself.

Back to your original question though; Probably best to push new image tags, then update the image on your app.

Once you have an image ref (like nick/test:v2) you can update your image.


Update all the machines running for the app:

fly deploy . --image <image ref>

Another option

This is a bit more low-level, but you can update a specific machine, instead of the whole app:

fly machines list # grab the ID of the machine to update
fly machines update --image <image ref> <machine ID>
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.