netunicorn.base.environment_definitions.DockerImage

class DockerImage(commands=<factory>, runtime_context=<factory>, image=None, build_context=<factory>)[source]

Bases: EnvironmentDefinition

This class represents Environment Definition that is created by using a Docker image.
If image name is not provided, then it would be created automatically
Parameters:
  • image (Optional[str], default: None) – Docker image name

  • build_context (BuildContext, default: <factory>) – build context for this environment definition

  • runtime_context (RuntimeContext, default: <factory>) – runtime context for this environment definition

  • commands (List[str], default: <factory>)

Attributes

image

Docker image name

build_context

Build context for this environment definition

runtime_context

Runtime context for this environment definition

commands

A list of commands that should be executed to create an environment.

Methods

from_json

Creates DockerImage from JSON representation.

commands: List[str][source]

A list of commands that should be executed to create an environment.

image: Optional[str] = None[source]

Docker image name

build_context: BuildContext[source]

Build context for this environment definition

runtime_context: RuntimeContext[source]

Runtime context for this environment definition

classmethod from_json(_data)[source]

Creates DockerImage from JSON representation.

Parameters:

_data (EnvironmentDefinitionRepresentation) – JSON representation of DockerImage

Returns:

DockerImage – Deserialized DockerImage