Looks like it’s failing at the rubocop linting stage - roughly line 710 in the log.
If you don’t want to lint the code, and just run tests, you can add -e SKIP_LINT=1
to the docker run command.
All the environment variables available are listed at the top of docker.rake:
https://github.com/discourse/discourse/blob/master/lib/tasks/docker.rake