类 DockerApi.ContainerApi
java.lang.Object
org.springframework.boot.buildpack.platform.docker.DockerApi.ContainerApi
- 封闭类:
DockerApi
Docker API for container operations.
-
方法概要
修饰符和类型方法说明create
(ContainerConfig config, ImagePlatform platform, ContainerContent... contents) Create a new container aContainerConfig
.void
logs
(ContainerReference reference, UpdateListener<LogUpdateEvent> listener) Return and follow logs for a specific container.void
remove
(ContainerReference reference, boolean force) Remove a specific container.void
start
(ContainerReference reference) Start a specific container.wait
(ContainerReference reference) Wait for a container to stop and retrieve the status.
-
方法详细资料
-
create
public ContainerReference create(ContainerConfig config, ImagePlatform platform, ContainerContent... contents) throws IOException Create a new container aContainerConfig
.- 参数:
config
- the container configplatform
- the platform (os/architecture/variant) of the image the container should be created fromcontents
- additional contents to include- 返回:
- a
ContainerReference
for the newly created container - 抛出:
IOException
- on IO error
-
start
Start a specific container.- 参数:
reference
- the container reference to start- 抛出:
IOException
- on IO error
-
logs
public void logs(ContainerReference reference, UpdateListener<LogUpdateEvent> listener) throws IOException Return and follow logs for a specific container.- 参数:
reference
- the container referencelistener
- a listener to receive log update events- 抛出:
IOException
- on IO error
-
wait
Wait for a container to stop and retrieve the status.- 参数:
reference
- the container reference- 返回:
- a
ContainerStatus
indicating the exit status of the container - 抛出:
IOException
- on IO error
-
remove
Remove a specific container.- 参数:
reference
- the container to removeforce
- if removal should be forced- 抛出:
IOException
- on IO error
-