public class ContainerDefinition extends Object implements Serializable, Cloneable
Container definitions are used in task definitions to describe the different containers that are launched as part of a task.
Constructor and Description |
---|
ContainerDefinition() |
Modifier and Type | Method and Description |
---|---|
ContainerDefinition |
clone() |
boolean |
equals(Object obj) |
List<String> |
getCommand()
The
CMD that is passed to the container. |
Integer |
getCpu()
The number of
cpu units reserved for the container. |
List<String> |
getEntryPoint()
|
List<KeyValuePair> |
getEnvironment()
The environment variables to pass to a container.
|
Boolean |
getEssential()
If the
essential parameter of a container is marked as
true , the failure of that container will stop the task. |
String |
getImage()
The image used to start a container.
|
List<String> |
getLinks()
The
link parameter allows containers to communicate with
each other without the need for port mappings, using the
name parameter. |
Integer |
getMemory()
The number of MiB of memory reserved for the container.
|
List<MountPoint> |
getMountPoints()
The mount points for data volumes in your container.
|
String |
getName()
The name of a container.
|
List<PortMapping> |
getPortMappings()
The list of port mappings for the container.
|
List<VolumeFrom> |
getVolumesFrom()
Data volumes to mount from another container.
|
int |
hashCode() |
Boolean |
isEssential()
If the
essential parameter of a container is marked as
true , the failure of that container will stop the task. |
void |
setCommand(Collection<String> command)
The
CMD that is passed to the container. |
void |
setCpu(Integer cpu)
The number of
cpu units reserved for the container. |
void |
setEntryPoint(Collection<String> entryPoint)
|
void |
setEnvironment(Collection<KeyValuePair> environment)
The environment variables to pass to a container.
|
void |
setEssential(Boolean essential)
If the
essential parameter of a container is marked as
true , the failure of that container will stop the task. |
void |
setImage(String image)
The image used to start a container.
|
void |
setLinks(Collection<String> links)
The
link parameter allows containers to communicate with
each other without the need for port mappings, using the
name parameter. |
void |
setMemory(Integer memory)
The number of MiB of memory reserved for the container.
|
void |
setMountPoints(Collection<MountPoint> mountPoints)
The mount points for data volumes in your container.
|
void |
setName(String name)
The name of a container.
|
void |
setPortMappings(Collection<PortMapping> portMappings)
The list of port mappings for the container.
|
void |
setVolumesFrom(Collection<VolumeFrom> volumesFrom)
Data volumes to mount from another container.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ContainerDefinition |
withCommand(Collection<String> command)
The
CMD that is passed to the container. |
ContainerDefinition |
withCommand(String... command)
The
CMD that is passed to the container. |
ContainerDefinition |
withCpu(Integer cpu)
The number of
cpu units reserved for the container. |
ContainerDefinition |
withEntryPoint(Collection<String> entryPoint)
|
ContainerDefinition |
withEntryPoint(String... entryPoint)
|
ContainerDefinition |
withEnvironment(Collection<KeyValuePair> environment)
The environment variables to pass to a container.
|
ContainerDefinition |
withEnvironment(KeyValuePair... environment)
The environment variables to pass to a container.
|
ContainerDefinition |
withEssential(Boolean essential)
If the
essential parameter of a container is marked as
true , the failure of that container will stop the task. |
ContainerDefinition |
withImage(String image)
The image used to start a container.
|
ContainerDefinition |
withLinks(Collection<String> links)
The
link parameter allows containers to communicate with
each other without the need for port mappings, using the
name parameter. |
ContainerDefinition |
withLinks(String... links)
The
link parameter allows containers to communicate with
each other without the need for port mappings, using the
name parameter. |
ContainerDefinition |
withMemory(Integer memory)
The number of MiB of memory reserved for the container.
|
ContainerDefinition |
withMountPoints(Collection<MountPoint> mountPoints)
The mount points for data volumes in your container.
|
ContainerDefinition |
withMountPoints(MountPoint... mountPoints)
The mount points for data volumes in your container.
|
ContainerDefinition |
withName(String name)
The name of a container.
|
ContainerDefinition |
withPortMappings(Collection<PortMapping> portMappings)
The list of port mappings for the container.
|
ContainerDefinition |
withPortMappings(PortMapping... portMappings)
The list of port mappings for the container.
|
ContainerDefinition |
withVolumesFrom(Collection<VolumeFrom> volumesFrom)
Data volumes to mount from another container.
|
ContainerDefinition |
withVolumesFrom(VolumeFrom... volumesFrom)
Data volumes to mount from another container.
|
public String getName()
name
of one container
can be entered in the links
of another container to
connect the containers.name
of one container
can be entered in the links
of another container to
connect the containers.public void setName(String name)
name
of one container
can be entered in the links
of another container to
connect the containers.name
- The name of a container. If you are linking multiple containers
together in a task definition, the name
of one container
can be entered in the links
of another container to
connect the containers.public ContainerDefinition withName(String name)
name
of one container
can be entered in the links
of another container to
connect the containers.
Returns a reference to this object so that method calls can be chained together.
name
- The name of a container. If you are linking multiple containers
together in a task definition, the name
of one container
can be entered in the links
of another container to
connect the containers.public String getImage()
repository-url/image:tag
.repository-url/image:tag
.public void setImage(String image)
repository-url/image:tag
.image
- The image used to start a container. This string is passed directly to
the Docker daemon. Images in the Docker Hub registry are available by
default. Other repositories are specified with
repository-url/image:tag
.public ContainerDefinition withImage(String image)
repository-url/image:tag
.
Returns a reference to this object so that method calls can be chained together.
image
- The image used to start a container. This string is passed directly to
the Docker daemon. Images in the Docker Hub registry are available by
default. Other repositories are specified with
repository-url/image:tag
.public Integer getCpu()
cpu
units reserved for the container. A
container instance has 1,024 cpu
units for every CPU
core.cpu
units reserved for the container. A
container instance has 1,024 cpu
units for every CPU
core.public void setCpu(Integer cpu)
cpu
units reserved for the container. A
container instance has 1,024 cpu
units for every CPU
core.cpu
- The number of cpu
units reserved for the container. A
container instance has 1,024 cpu
units for every CPU
core.public ContainerDefinition withCpu(Integer cpu)
cpu
units reserved for the container. A
container instance has 1,024 cpu
units for every CPU
core.
Returns a reference to this object so that method calls can be chained together.
cpu
- The number of cpu
units reserved for the container. A
container instance has 1,024 cpu
units for every CPU
core.public Integer getMemory()
public void setMemory(Integer memory)
memory
- The number of MiB of memory reserved for the container. Docker will
allocate a minimum of 4 MiB of memory to a container.public ContainerDefinition withMemory(Integer memory)
Returns a reference to this object so that method calls can be chained together.
memory
- The number of MiB of memory reserved for the container. Docker will
allocate a minimum of 4 MiB of memory to a container.public List<String> getLinks()
link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.public void setLinks(Collection<String> links)
link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.links
- The link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.public ContainerDefinition withLinks(String... links)
link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.
Returns a reference to this object so that method calls can be chained together.
links
- The link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.public ContainerDefinition withLinks(Collection<String> links)
link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.
Returns a reference to this object so that method calls can be chained together.
links
- The link
parameter allows containers to communicate with
each other without the need for port mappings, using the
name
parameter. For more information on linking Docker
containers, see https://docs.docker.com/userguide/dockerlinks/.public List<PortMapping> getPortMappings()
public void setPortMappings(Collection<PortMapping> portMappings)
portMappings
- The list of port mappings for the container.public ContainerDefinition withPortMappings(PortMapping... portMappings)
Returns a reference to this object so that method calls can be chained together.
portMappings
- The list of port mappings for the container.public ContainerDefinition withPortMappings(Collection<PortMapping> portMappings)
Returns a reference to this object so that method calls can be chained together.
portMappings
- The list of port mappings for the container.public Boolean isEssential()
essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.public void setEssential(Boolean essential)
essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.essential
- If the essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.public ContainerDefinition withEssential(Boolean essential)
essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.
Returns a reference to this object so that method calls can be chained together.
essential
- If the essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.public Boolean getEssential()
essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.essential
parameter of a container is marked as
true
, the failure of that container will stop the task.
If the essential
parameter of a container is marked as
false
, then its failure will not affect the rest of the
containers in a task.public List<String> getEntryPoint()
Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
public void setEntryPoint(Collection<String> entryPoint)
Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
entryPoint
- Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
public ContainerDefinition withEntryPoint(String... entryPoint)
Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
Returns a reference to this object so that method calls can be chained together.
entryPoint
- Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
public ContainerDefinition withEntryPoint(Collection<String> entryPoint)
Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
Returns a reference to this object so that method calls can be chained together.
entryPoint
- Early versions of the Amazon ECS container agent do not
properly handle entryPoint
parameters. If you have
problems using entryPoint
, update your container agent or
enter your commands and arguments as command
array items
instead.
The ENTRYPOINT
that is passed to
the container. For more information on the Docker
ENTRYPOINT
parameter, see https://docs.docker.com/reference/builder/#entrypoint.
public List<String> getCommand()
CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.public void setCommand(Collection<String> command)
CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.command
- The CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.public ContainerDefinition withCommand(String... command)
CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.
Returns a reference to this object so that method calls can be chained together.
command
- The CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.public ContainerDefinition withCommand(Collection<String> command)
CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.
Returns a reference to this object so that method calls can be chained together.
command
- The CMD
that is passed to the container. For more
information on the Docker CMD
parameter, see https://docs.docker.com/reference/builder/#cmd.public List<KeyValuePair> getEnvironment()
public void setEnvironment(Collection<KeyValuePair> environment)
environment
- The environment variables to pass to a container.public ContainerDefinition withEnvironment(KeyValuePair... environment)
Returns a reference to this object so that method calls can be chained together.
environment
- The environment variables to pass to a container.public ContainerDefinition withEnvironment(Collection<KeyValuePair> environment)
Returns a reference to this object so that method calls can be chained together.
environment
- The environment variables to pass to a container.public List<MountPoint> getMountPoints()
public void setMountPoints(Collection<MountPoint> mountPoints)
mountPoints
- The mount points for data volumes in your container.public ContainerDefinition withMountPoints(MountPoint... mountPoints)
Returns a reference to this object so that method calls can be chained together.
mountPoints
- The mount points for data volumes in your container.public ContainerDefinition withMountPoints(Collection<MountPoint> mountPoints)
Returns a reference to this object so that method calls can be chained together.
mountPoints
- The mount points for data volumes in your container.public List<VolumeFrom> getVolumesFrom()
public void setVolumesFrom(Collection<VolumeFrom> volumesFrom)
volumesFrom
- Data volumes to mount from another container.public ContainerDefinition withVolumesFrom(VolumeFrom... volumesFrom)
Returns a reference to this object so that method calls can be chained together.
volumesFrom
- Data volumes to mount from another container.public ContainerDefinition withVolumesFrom(Collection<VolumeFrom> volumesFrom)
Returns a reference to this object so that method calls can be chained together.
volumesFrom
- Data volumes to mount from another container.public String toString()
toString
in class Object
Object.toString()
public ContainerDefinition clone()
Copyright © 2015. All rights reserved.