Is is possible to run docker-in-docker on AWS batch?
I have tried the approach of mounting the docker socket via the container properties:
container_properties = <<CONTAINER_PROPERTIES
{
"command": ["docker", "run", "my container"],
"image": "docker/compose",
"jobRoleArn": "my-role",
"memory": 2000,
"vcpus": 1,
"privileged": true,
"mountPoints": [
{
"sourceVolume": "/var/run/docker.sock",
"containerPath": "/var/run/docker.sock",
"readOnly": false
}
]
}
However running this batch job in a SPOT compute environment with default configuration yields a job that immediately transitions to FAILED status with the status transition reason:
Status reason
Unknown volume '/var/run/docker.sock'.