-
-
Save lkraider/7cedf254bfb39494342d974d7c5a90a7 to your computer and use it in GitHub Desktop.
jsen schema to validate Dockerrun.aws.json files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"required": [ | |
"AWSEBDockerrunVersion", | |
"containerDefinitions", | |
"volumes" | |
], | |
"properties": { | |
"AWSEBDockerrunVersion": { | |
"type": "integer", | |
"minimum": 1, | |
"maximum": 2 | |
}, | |
"authentication": { | |
"type": "object", | |
"properties": { | |
"bucket": { | |
"type": "string" | |
}, | |
"key": { | |
"type": "string" | |
} | |
} | |
}, | |
"volumes": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"required": [ | |
"name" | |
], | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"host": { | |
"type": "object", | |
"properties": { | |
"sourcePath": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"containerDefinitions": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"required": [ | |
"name", | |
"image" | |
], | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"image": { | |
"type": "string" | |
}, | |
"cpu": { | |
"type": "integer" | |
}, | |
"memory": { | |
"type": "integer" | |
}, | |
"memoryReservation": { | |
"type": "integer" | |
}, | |
"essential": { | |
"type": "boolean" | |
}, | |
"command": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"mountPoints": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"required": [ | |
"sourceVolume", | |
"containerPath" | |
], | |
"properties": { | |
"sourceVolume": { | |
"type": "string" | |
}, | |
"containerPath": { | |
"type": "string" | |
}, | |
"readOnly": { | |
"type": "boolean" | |
} | |
} | |
} | |
}, | |
"volumesFrom": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"required": [ | |
"sourceContainer" | |
], | |
"properties": { | |
"sourceContainer": { | |
"type": "string" | |
}, | |
"readOnly": { | |
"type": "boolean" | |
} | |
} | |
} | |
}, | |
"portMappings": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"required": [ | |
"containerPort" | |
], | |
"properties": { | |
"containerPort": { | |
"type": "integer" | |
}, | |
"hostPort": { | |
"type": "integer" | |
}, | |
"protocol": { | |
"type": "string" | |
} | |
} | |
} | |
}, | |
"environment": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"required": [ | |
"name", | |
"value" | |
], | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"value": { | |
"type": "string" | |
} | |
} | |
} | |
}, | |
"links": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"entryPoint": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"workingDirectory": { | |
"type": "string" | |
}, | |
"disableNetworking": { | |
"type": "boolean" | |
}, | |
"hostname": { | |
"type": "string" | |
}, | |
"dnsServers": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"dnsSearchDomains": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"extraHosts": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"required": [ | |
"hostname", | |
"ipAddress" | |
], | |
"properties": { | |
"hostname": { | |
"type": "string" | |
}, | |
"ipAddress": { | |
"type": "string" | |
} | |
} | |
} | |
}, | |
"readonlyRootFilesystem": { | |
"type": "boolean" | |
}, | |
"privileged": { | |
"type": "boolean" | |
}, | |
"user": { | |
"type": "string" | |
}, | |
"dockerSecurityOptions": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Nice! Thanks for the snippet.
It does not work for AWSEBDockerrunVersion 1, as it still looks for containerDefinitions and volumes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
refs:
http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html