Dockerfile and Doppler CLI updates?

I keep changing dev environments, which I develop inside, very frequently trough out the day and normally I use the command echo 'TOKEN' | doppler configure set token --scope / to load my service token for the container. Today however I got the following error

An update is available.
CLI v3.38.0
· (BETA) Add support for dynamic secrets in secret commands

? Install Doppler CLI v3.38.0 (Y/n) Doppler Error: EOF

Which made me wonder what is a good way to keep the Doppler CLI up to date inside the container? Currently I have the it install normally with the Dockerfile RUN command (shell version).

Hi @minahanse,

Welcome to the Doppler Community!

When using Docker containers, you typically just rebuild the image with the new Doppler CLI when an update happens and then use the new image. You could, of course, run either doppler update (if you installed via the shell script) or upgrade via the package manager in your container after it runs as well, but the recommended thing to do would be to rebuild the image. You can also use the --no-check-version flag to avoid the update prompt in automated environments.

As far as keeping your images up-to-date, one way you might be able to address this is to use a CI / CD system to automatically perform routine image builds. If you’re using the latest tag for the image, then this would automatically pickup Doppler CLI updates. When combined with the --no-check-version flag, this should allow your automated jobs using the image to run without interruption while also ensuring the CLI stays up-to-date.

One last thing to mention – you can set the --scope of the token you’re setting to a particular directory rather than the global root directory. For example, if you had a project in ~/dev/app1, you could set that as the scope (using the full path) and executing doppler commands from that directory would then use the token you set for that location. This would let you have different tokens set for different projects without having to run a doppler configure each time.

Let me know if you have any other questions!

Thanks,
-Joel