Skip to content

Instantly share code, notes, and snippets.

@yonglai
Created May 24, 2022 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yonglai/6dee453169d2aaec2b4de10f1153cf69 to your computer and use it in GitHub Desktop.
Save yonglai/6dee453169d2aaec2b4de10f1153cf69 to your computer and use it in GitHub Desktop.
mount docker sock in container
resource "aws_batch_job_definition" "kitten-transfer" {
name = "kitten-transfer"
type = "container"
platform_capabilities = ["EC2"]
parameters = var.batch_parameters
container_properties = <<CONTAINER_PROPERTIES
{
"command": ["Ref::command", "Ref::parameters"],
"image": "406641514508.dkr.ecr.us-east-1.amazonaws.com/kitten-transfer:latest",
"memory": 1024,
"vcpus": 1,
"volumes": [
{
"host": {
"sourcePath": "/var/run/docker.sock"
},
"name": "docker"
}
],
"mountPoints": [
{
"sourceVolume": "docker",
"containerPath": "/var/run/docker.sock"
}
]
}
CONTAINER_PROPERTIES
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment