Skip to content

Commit 97573bf

Browse files
authored
Merge pull request #201 from crazy-max/colima-update
docker(install): fallback to journalctl to print docker daemon logs
2 parents 624fee6 + cef4c16 commit 97573bf

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ jobs:
7878
test: ${{ fromJson(needs.prepare-itg.outputs.matrix) }}
7979
os:
8080
- ubuntu-latest
81+
- macos-13
8182
- macos-latest
8283
- windows-latest
8384
exclude:
85+
- os: macos-13
86+
test: buildx/bake.test.itg.ts
8487
- os: macos-latest
8588
test: buildx/bake.test.itg.ts
8689
- os: windows-latest

__tests__/docker/install.test.itg.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('install', () => {
3030
process.env = {
3131
...originalEnv,
3232
SIGN_QEMU_BINARY: '1',
33-
COLIMA_START_ARGS: '--cpu 4 --memory 8 --disk 32 --dns 1.1.1.1 --dns 8.8.8.8 --dns-host example.com=1.2.3.4'
33+
COLIMA_START_ARGS: '--cpu 4 --memory 8 --disk 32'
3434
};
3535
});
3636
afterEach(() => {
@@ -52,5 +52,5 @@ describe('install', () => {
5252
await Docker.printInfo();
5353
await install.tearDown();
5454
})()).resolves.not.toThrow();
55-
}, 600000);
55+
}, 1200000);
5656
});

src/docker/assets.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,6 @@ network:
187187
dnsHosts:
188188
host.docker.internal: host.lima.internal
189189
190-
# Network driver to use (slirp, gvproxy), (requires vmType \`qemu\`)
191-
# - slirp is the default user mode networking provided by Qemu
192-
# - gvproxy is an alternative to VPNKit based on gVisor https://github.com/containers/gvisor-tap-vsock
193-
# Default: gvproxy
194-
driver: gvproxy
195-
196190
# Forward the host's SSH agent to the virtual machine.
197191
# Default: false
198192
forwardAgent: false
@@ -242,14 +236,6 @@ mountType: 9p
242236
# Default: host
243237
cpuType: host
244238
245-
# For a more general purpose virtual machine, Ubuntu container is optionally provided
246-
# as a layer on the virtual machine.
247-
# The underlying virtual machine is still accessible via \`colima ssh --layer=false\` or running \`colima\` in
248-
# the Ubuntu session.
249-
#
250-
# Default: false
251-
layer: false
252-
253239
# Custom provision scripts for the virtual machine.
254240
# Provisioning scripts are executed on startup and therefore needs to be idempotent.
255241
#
@@ -270,10 +256,7 @@ layer: false
270256
provision:
271257
- mode: system
272258
script: |
273-
mkdir -p /tmp/docker-bins
274-
cd /tmp/docker-bins
275-
wget -qO- "https://download.docker.com/linux/static/{{dockerBinChannel}}/{{dockerBinArch}}/docker-{{dockerBinVersion}}.tgz" | tar xvz --strip 1
276-
mv -f /tmp/docker-bins/* /usr/bin/
259+
wget -qO- "https://download.docker.com/linux/static/{{dockerBinChannel}}/{{dockerBinArch}}/docker-{{dockerBinVersion}}.tgz" | tar xvz --strip 1 -C /usr/bin/
277260
278261
# Modify ~/.ssh/config automatically to include a SSH config for the virtual machine.
279262
# SSH config will still be generated in ~/.colima/ssh_config regardless.

src/docker/install.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,11 @@ EOF`,
362362

363363
private async tearDownDarwin(): Promise<void> {
364364
await core.group('Docker daemon logs', async () => {
365-
await Exec.exec('colima', ['exec', '--', 'cat', '/var/log/docker.log']);
365+
await Exec.exec('colima', ['exec', '--', 'cat', '/var/log/docker.log']).catch(async () => {
366+
await Exec.exec('colima', ['exec', '--', 'sudo', 'journalctl', '-u', 'docker.service', '-l', '--no-pager']).catch(() => {
367+
core.warning(`Failed to get Docker daemon logs`);
368+
});
369+
});
366370
});
367371
await core.group('Stopping colima', async () => {
368372
await Exec.exec('colima', ['stop', '--very-verbose']);

0 commit comments

Comments
 (0)