Why docker:// does not work inside the Atlas Docker image
Question
Why does using a dev URL like docker://postgres/15/dev inside the official arigaio/atlas image fail with:
exec: "docker": executable file not found in $PATH?
Why does using a dev URL like docker://postgres/15/dev inside the official arigaio/atlas image fail with:
exec: "docker": executable file not found in $PATH?
What encoding is used by Atlas for schema files? How do you avoid encoding issues with PowerShell on Windows?
Atlas uses UTF-8 to encode schema files and migration files generated by Atlas. UTF-8 is the default encoding on nearly all system terminals, but on Windows, PowerShell uses UTF-16 by default. This can cause an encoding issue when Atlas loads the schema files generated by the inspect command.
When using Atlas on my macOS, I can run atlas migrate apply without any issues, and it applies the migrations successfully.
But when running in CI on linux, I get the following error: Error: checksum mismatch
This issue is likely due to differences in line endings between operating systems. macOS uses LF (Line Feed) for line endings,
while Windows uses CRLF (Carriage Return + Line Feed). When you run Atlas commands in a Docker container,
it may be using a different line ending format than what your migrations were created with.
How to detect schema drift in CI and ensure the migration directory is up to date with the desired schema state - ORM, HCL, SQL, or any other schema definition?