Question

App is still running old docker image after successful deployment

My App is probably still running on an old docker image although I have pushed a newer images to the DO registry and the registry is also showing the correct SHA256 image ID.

I’ve successfully deployed the App a few times but it’s still showing old content. How can I verify, that my App is running on the same docker image ID/hash that the registry is displaying? I can’t find that information on the Apps control panel.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The issue was that I was always using the docker tag “:latest”. I don’t know why deployments worked for a couple of weeks but now it isn’t working anymore. My workaround is to use different tags now and put the new images into the app spec file like this:

doctl registry login
docker push $IMAGE_NAME

doctl apps spec get $DO_APP_ID > $SPEC_FILE

# Replace image in app spec
echo "Setting tag $TAG"
sed -i '' "s/tag: [a-z0-9]*$/tag: $TAG/g" app_spec.yml
doctl apps spec validate $SPEC_FILE

doctl apps update $DO_APP_ID --spec $SPEC_FILE

its concerning that this hasnt been addressed in over a year.

what ive found works is to use the create-deployment command with the “force-rebuild” option. oddly named considering the image is already built but i digress.

here is the command

doctl app create-deployment <app ID> --force-rebuild

# shorthand
doctl a cd <app ID> --force-rebuild

the bummer here is if you change the spec (which creates a new deployment) there is no “force-rebuild” for the update command. so you have to do both

doctl app update <app ID> --spec <app-spec>.yaml
doctl app create-deployment <app ID> --force-rebuild

#shorthand
doctl a u <app ID> --spec <app-spec>.yaml
doctl a cd <app ID> --force-rebuild

Hello @rgnrlbrk, contrary to what the documentation would lead us to believe, automatic deployments after updating an image don’t actually work.