Class DockerApi.ContainerApi
java.lang.Object
org.springframework.boot.buildpack.platform.docker.DockerApi.ContainerApi
- Enclosing class:
- DockerApi
Docker API for container operations.
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(ContainerConfig config, 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.
-
Method Details
-
create
public ContainerReference create(ContainerConfig config, ContainerContent... contents) throws IOException Create a new container aContainerConfig
.- Parameters:
config
- the container configcontents
- additional contents to include- Returns:
- a
ContainerReference
for the newly created container - Throws:
IOException
- on IO error
-
start
Start a specific container.- Parameters:
reference
- the container reference to start- Throws:
IOException
- on IO error
-
logs
public void logs(ContainerReference reference, UpdateListener<LogUpdateEvent> listener) throws IOException Return and follow logs for a specific container.- Parameters:
reference
- the container referencelistener
- a listener to receive log update events- Throws:
IOException
- on IO error
-
wait
Wait for a container to stop and retrieve the status.- Parameters:
reference
- the container reference- Returns:
- a
ContainerStatus
indicating the exit status of the container - Throws:
IOException
- on IO error
-
remove
Remove a specific container.- Parameters:
reference
- the container to removeforce
- if removal should be forced- Throws:
IOException
- on IO error
-