Skip to content

Instantly share code, notes, and snippets.

@lkraider
Forked from sordina/dockerrun-jsen-schema.json
Last active August 17, 2021 16:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save lkraider/7cedf254bfb39494342d974d7c5a90a7 to your computer and use it in GitHub Desktop.
Save lkraider/7cedf254bfb39494342d974d7c5a90a7 to your computer and use it in GitHub Desktop.
jsen schema to validate Dockerrun.aws.json files
{
"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"
}
}
}
}
}
}
}
@dubrox
Copy link

dubrox commented Dec 26, 2018

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