chriszarate / docker-compose-wordpress

An example Docker Compose setup for WordPress plugin or theme development.
162 stars 54 forks source link

Issue Running install-wp-tests.sh in Test Container #18

Open danielshawellis opened 4 years ago

danielshawellis commented 4 years ago

When running this command: docker-compose -f docker-compose.phpunit.yml run --rm wordpress_phpunit /app/bin/install-wp-tests.sh wordpress_test root '' mysql_phpunit latest true

I'm seeing this error: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"C:/Program Files/Git/app/bin/install-wp-tests. sh\": stat C:/Program Files/Git/app/bin/install-wp-tests.sh: no such file or directory": unknown

To fix it, I'm entering the testing container with docker-compose -f docker-compose.phpunit.yml run --rm wordpress_phpunit bash, then I'm changing to the /app/bin/ directory and running ./install-wp-tests.sh wordpress_test root '' mysql_phpunit latest true

However, sometimes when I do this I'm seeing this error: ':No such file or directory

I believe that this is happening because the line breaks in install-wp-tests.sh are being reformatted to DOS carriage-return characters.

I was able to fix this issue by formatting that file back to UNIX-readable line breaks.

After entering the test container and changing to the /app/bin/ directory, as described above, I ran this command to change the formatting of the line breaks back to UNIX: dos2unix install-wp-tests.sh

At this point, I was able to run ./install-wp-tests.sh wordpress_test root '' mysql_phpunit latest true without an issue.