1
votes

I'm attempting to run the following command in CodeBuild:

- docker run --rm -v $(pwd)/SQL:/flyway/SQL -v $(pwd)/conf:/flyway/conf flyway/flyway -enterprise -url=jdbc:postgresql://xxx.xxx.us-east-1.rds.amazonaws.com:5432/hamshackradio -dryRunOutput="/flyway/SQL/output.sql" migrate

I get the following error:

ERROR: Unable to use /flyway/SQL/output.sql as a dry run output: /flyway/SQL/output.sql (Permission denied) Caused by: java.io.FileNotFoundException: /flyway/SQL/output.sql (Permission denied)

The goal is to capture the output.sql file. Running the exact same command locally on Windows (adjusting the paths of course) works without error. The issue isn't Flyway or the overall command structure. It's something to do with the internals of running the Docker container on Ubuntu on AWS CodeBuild and permissions there (maybe permissions, maybe something else, I'm open).

Does anyone have a good idea on how to address this?

1

1 Answers

0
votes

You need to enable Privileged Mode for your CodeBuild project.