We’re looking for a way to get the logs back from a docker container run. We deploy the main application container then run some functional tests against it from another container. Is there a way to get those docker logs back into the octopus log?
I can’t see a way to run a container without the ‘-d’ flag so I can’t grab them with ‘-it’.
The only way I can think of is to run a second command “docker logs <conatiner-id/name>” after the test run to get the logs… But that presents more questions.
How do I know the container id/name from the previous step?
How do I know how long to wait? I guess I can put the logs command in a loop, so that I wait for an ‘exited’ status.
Before I go through the headache of that solution, I would like to know if there’s a better way that I’m just missing.
You can get the details of a Docker container deployed in a previous step through the [Octopus.Action[The step name goes here].Output.Docker.Inspect] variable.