Skip to content

Commit

Permalink
docker(install): fallback to journalctl to print docker daemon logs
Browse files Browse the repository at this point in the history
colima only supports Ubuntu image since 0.6.0 which
runs docker as systemd unit.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Nov 16, 2023
1 parent f8909e3 commit 03b93c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/docker/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,11 @@ EOF`,

private async tearDownDarwin(): Promise<void> {
await core.group('Docker daemon logs', async () => {
await Exec.exec('colima', ['exec', '--', 'cat', '/var/log/docker.log']);
await Exec.exec('colima', ['exec', '--', 'cat', '/var/log/docker.log']).catch(async () => {
await Exec.exec('colima', ['exec', '--', 'sudo', 'journalctl', '-u', 'docker.service', '-l', '--no-pager']).catch(() => {
core.warning(`Failed to get Docker daemon logs`);
});
});
});
await core.group('Stopping colima', async () => {
await Exec.exec('colima', ['stop', '--very-verbose']);
Expand Down

0 comments on commit 03b93c3

Please sign in to comment.