Expand logging, and daemonless command support.

This adds more logging in certain places, and adds logging to the CLI.
It also allows for certain commands in the CLI to be used without a
daemon connection, namely `init`, which previously required the daemon
to be connected, but now does not since it doesnt need it.
This commit is contained in:
Zoe
2025-05-08 09:53:41 -05:00
parent 5bb696052a
commit c51eca5dab
16 changed files with 538 additions and 470 deletions

View File

@@ -87,9 +87,11 @@ func (d *DockerClient) StartContainer(ctx context.Context, containerID DockerID)
return d.client.ContainerStart(ctx, string(containerID), container.StartOptions{})
}
// blocks until the container returns a 200 status code
const CONTAINER_START_TIMEOUT = 30 * time.Second
// blocks until the container returns a 200 status code for a max of CONTAINER_START_TIMEOUT (30 seconds)
func (d *DockerClient) ContainerWait(ctx context.Context, containerID DockerID, port uint16) error {
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
ctx, cancel := context.WithTimeout(ctx, CONTAINER_START_TIMEOUT)
defer cancel()
for {