Volume not available in release_command

A few days ago I deployed a toy phoenix web application backed by a SQLite database. The fly CLI generated a proper Dockerfile for it and a fly.toml with a release_command that ensures migrations are run. I created a volume and configured it to be mounted at /data. The directory is visible from the shell of the launched application (checked with fly ssh console + ls /), but it is not visible from the migration script (checked by adding ls -la / to the migration script and looking at the logs).

Is this a bug?

Sorry, I should have checked the docs more thoroughly. This behavior is explicitly mentioned:

The temporary VM has full access to the network, environment variables and secrets, but not to persistent volumes. Changes made to the filesystem on the temporary VM will not be retained or deployed. If you need to modify persistent volumes or configure your application, consider making use of CMD or ENTRYPOINT in your Dockerfile.

1 Like