Skip to content

Commit

Permalink
docker(install): fix provisioning for colima 0.6
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 26, 2023
1 parent fc10bff commit 32fc0b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
15 changes: 11 additions & 4 deletions __tests__/docker/install.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
* limitations under the License.
*/

import path from 'path';
import {jest, describe, expect, test, beforeEach, afterEach} from '@jest/globals';
import path from 'path';
import * as core from '@actions/core';

import {Install} from '../../src/docker/install';
import {Docker} from '../../src/docker/docker';
Expand Down Expand Up @@ -46,10 +47,16 @@ describe('install', () => {
contextName: 'foo',
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`
});
await install.download();
await core.group('Downloading docker', async () => {
await install.download();
});
await install.install();
await Docker.printVersion();
await Docker.printInfo();
await core.group('Docker version', async () => {
await Docker.printVersion();
});
await core.group('Docker info', async () => {
await Docker.printInfo();
});
await install.tearDown();
})()).resolves.not.toThrow();
}, 1200000);
Expand Down
12 changes: 10 additions & 2 deletions src/docker/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,13 @@ cpuType: host
provision:
- mode: system
script: |
wget -qO- "https://download.docker.com/linux/static/{{dockerBinChannel}}/{{dockerBinArch}}/docker-{{dockerBinVersion}}.tgz" | tar xvz --strip 1 -C /usr/bin/
if [ -f ~/.install-docker ]; then
exit 0
fi
if [ -f /etc/alpine-release ]; then
wget -qO- "https://download.docker.com/linux/static/{{dockerBinChannel}}/{{dockerBinArch}}/docker-{{dockerBinVersion}}.tgz" | tar xvz --strip 1 -C /usr/bin/
fi
touch ~/.install-docker
# Modify ~/.ssh/config automatically to include a SSH config for the virtual machine.
# SSH config will still be generated in ~/.colima/ssh_config regardless.
Expand Down Expand Up @@ -286,7 +292,9 @@ mounts: []
# ANOTHER_KEY: another value
#
# Default: {}
env: {}
env:
DOCKER_INSTALL_CHANNEL: {{dockerBinChannel}}
DOCKER_INSTALL_VERSION: {{dockerBinVersion}}
`;

export const qemuEntitlements = `
Expand Down

0 comments on commit 32fc0b9

Please sign in to comment.