I'm trying to run multiple shell commands through Docker using AWS Batch and boto3. When I try to submit multiple commands using the & sign as follows, the job fails.
My attempt
import boto3
client = boto3.client("batch")
response = client.submit_job(
jobName='AndrewJob',
jobQueue='AndrewJobQueue',
jobDefinition='AndrewJobDefinition',
containerOverrides={
'command': 'ls & python myjob.py'.split(),
},
timeout = {'attemptDurationSeconds': 100}
)
print(response)
The error is:
ls: cannot access '&': No such file or directory
According to the Docker Docs here https://docs.docker.com/engine/reference/builder/#cmd and this post here docker run <IMAGE> <MULTIPLE COMMANDS> it seems like this should be possible in shell form.