Skip to content

Commit

Permalink
docker(install): fix provisioning for colima >= 0.6.0
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 19, 2023
1 parent 64a550a commit 34d8584
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 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
9 changes: 8 additions & 1 deletion src/docker/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,14 @@ 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 /etc/alpine-release ]; then
wget -qO- "https://download.docker.com/linux/static/{{dockerBinChannel}}/{{dockerBinArch}}/docker-{{dockerBinVersion}}.tgz" | tar xvz --strip 1 -C /usr/bin/
else
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get -y remove $pkg; done
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh --channel {{dockerBinChannel}} --version {{dockerBinVersion}}
rm ./get-docker.sh
fi
# 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

0 comments on commit 34d8584

Please sign in to comment.