I'm trying to run a Nextflow workflow with AWS Batch, but all my jobs fail with the following error:
The user value contains invalid characters. Enter a value that matches the pattern ^([a-z0-9_][a-z0-9_-]{0,30})$
In the container section of the job details page, the user value is $(id, which I'm assuming is the cause of this error. I think this is happening because in my nexflow.config file, I have the following line:
containerOptions = { workflow.containerEngine == "docker" ? '-u $(id -u):$(id -g)': null}
I believe this line is supposed to avoid having Docker run as root, though if I remove the line completely my jobs never get past the "Runnable" state in AWS Batch.
The full workflow I'm trying to run is a small test workflow from a course, and is on GitHub here: https://github.com/biocorecrg/SIB_course_nextflow_Nov_2021/tree/main/nextflow/test3
I'm running it with the command nextflow run test3.nf -with-docker -profile cloud.