diff --git a/src/schemas/json/aspire-8.0.json b/src/schemas/json/aspire-8.0.json index 0e4071d5d0f..a757ca5c6f7 100644 --- a/src/schemas/json/aspire-8.0.json +++ b/src/schemas/json/aspire-8.0.json @@ -19,7 +19,7 @@ "oneOf": [ { "type": "object", - "description": "A resource that represents a Dockerfile that will be built into a container duing deployment.", + "description": "A resource that represents a Dockerfile that will be built into a container during deployment.", "required": ["type", "path", "context"], "properties": { "type": { @@ -38,6 +38,9 @@ }, "bindings": { "$ref": "#/definitions/bindings" + }, + "buildArgs": { + "$ref": "#/definitions/buildArgs" } }, "additionalProperties": false @@ -73,6 +76,54 @@ "bindMounts": { "$ref": "#/definitions/bindMounts" }, + "volumes": { + "$ref": "#/definitions/volumes" + }, + "build": false + }, + "additionalProperties": false + }, + { + "type": "object", + "description": "A generic container resource.", + "oneOf": [ + { + "required": ["type", "build"] + }, + { + "required": ["type", "image"] + } + ], + "properties": { + "type": { + "const": "container.v1" + }, + "image": { + "type": "string", + "description": "A string representing the container image to be used." + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint to use for the container image when executed." + }, + "args": { + "$ref": "#/definitions/args" + }, + "build": { + "$ref": "#/definitions/build" + }, + "connectionString": { + "$ref": "#/definitions/connectionString" + }, + "env": { + "$ref": "#/definitions/env" + }, + "bindings": { + "$ref": "#/definitions/bindings" + }, + "bindMounts": { + "$ref": "#/definitions/bindMounts" + }, "volumes": { "$ref": "#/definitions/volumes" } @@ -113,7 +164,7 @@ }, "workingDirectory": { "type": "string", - "description": "The path to the working directory. Should be intepretted as being relative to the AppHost directory." + "description": "The path to the working directory. Should be interpreted as being relative to the AppHost directory." }, "command": { "type": "string", @@ -377,6 +428,7 @@ "enum": [ "parameter.v0", "container.v0", + "container.v1", "dockerfile.v0", "project.v0", "value.v0", @@ -416,6 +468,72 @@ "type": "string" } }, + "build": { + "type": "object", + "description": "An object that captures properties that control the building of a container image.", + "required": ["context", "dockerfile"], + "properties": { + "context": { + "type": "string", + "description": "The path to the context directory for the container build. Can be relative of absolute. If relative it is relative to the location of the manifest file." + }, + "dockerfile": { + "type": "string", + "description": "The path to the Dockerfile. Can be relative or absolute. If relative it is relative to the manifest file." + }, + "args": { + "type": "object", + "description": "A list of build arguments which are used during container build.", + "additionalProperties": { + "type": "string" + } + }, + "secrets": { + "type": "object", + "description": "A list of build arguments which are used during container build.", + "additionalProperties": { + "type": "object", + "required": ["type"], + "oneOf": [ + { + "required": ["type", "value"], + "properties": { + "type": { + "type": "string", + "const": "env" + }, + "value": { + "type": "string", + "description": "If provided use as the value for the environment variable when docker build is run." + } + } + }, + { + "required": ["type", "source"], + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "source": { + "type": "string", + "description": "Path to secret file. If relative, the path is relative to the manifest file." + } + } + } + ] + } + } + }, + "additionalProperties": false + }, + "buildArgs": { + "type": "object", + "description": "A list of build arguments which are used during container build (for dockerfile.v0 resource type).", + "additionalProperties": { + "type": "string" + } + }, "bindings": { "type": "object", "description": "A list of port bindings for the resource when it is deployed.", diff --git a/src/test/aspire-8.0/withdockerfile.json b/src/test/aspire-8.0/withdockerfile.json new file mode 100644 index 00000000000..fe3ee6472a3 --- /dev/null +++ b/src/test/aspire-8.0/withdockerfile.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://json.schemastore.org/aspire-8.0.json", + "resources": { + "goversion": { + "inputs": { + "value": { + "type": "string" + } + }, + "type": "parameter.v0", + "value": "{goversion.inputs.value}" + }, + "mycontainer": { + "build": { + "args": { + "GO_VERSION": "{goversion.value}" + }, + "context": "qots", + "dockerfile": "qots/Dockerfile", + "secrets": { + "SECRET_ASENV": { + "type": "env", + "value": "{secret.value}" + }, + "SECRET_ASFILE": { + "source": "Program.cs", + "type": "file" + } + } + }, + "type": "container.v1" + }, + "secret": { + "inputs": { + "value": { + "secret": true, + "type": "string" + } + }, + "type": "parameter.v0", + "value": "{secret.inputs.value}" + } + } +}