From f05173ab6c84adba7ab82f690f69313e1513f329 Mon Sep 17 00:00:00 2001 From: Amir Szekely Date: Thu, 31 Oct 2024 20:29:02 -0400 Subject: [PATCH] fix: "No package docker available" on AL2 (#649) Installing Docker on Amazon Linux 2 based images failed with: ``` 4.636 No package docker available. 4.879 Error: Nothing to do ------ Dockerfile:19 -------------------- 17 | 18 | COPY component5-Docker.sh /tmp 19 | >>> RUN /tmp/component5-Docker.sh 20 | 21 | COPY component6-GithubRunner.sh /tmp -------------------- ERROR: failed to solve: process "/bin/sh -c /tmp/component5-Docker.sh" did not complete successfully: exit code: 1 ``` Fixes #646 --- src/image-builders/components.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/image-builders/components.ts b/src/image-builders/components.ts index d37ed3f6..862c47bc 100644 --- a/src/image-builders/components.ts +++ b/src/image-builders/components.ts @@ -386,8 +386,8 @@ export abstract class RunnerImageComponent { ]; } else if (os.is(Os.LINUX_AMAZON_2)) { return [ - 'yum install -y docker', - 'sudo usermod -a -G docker runner', + 'amazon-linux-extras install docker', + 'usermod -a -G docker runner', 'curl -sfLo /usr/bin/docker-compose https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s | tr \'[:upper:]\' \'[:lower:]\')-$(uname -m)', 'chmod +x /usr/bin/docker-compose', 'ln -s /usr/bin/docker-compose /usr/libexec/docker/cli-plugins/docker-compose', @@ -395,7 +395,7 @@ export abstract class RunnerImageComponent { } else if (os.is(Os.LINUX_AMAZON_2023)) { return [ 'dnf install -y docker', - 'sudo usermod -a -G docker runner', + 'usermod -a -G docker runner', 'curl -sfLo /usr/bin/docker-compose https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s | tr \'[:upper:]\' \'[:lower:]\')-$(uname -m)', 'chmod +x /usr/bin/docker-compose', 'ln -s /usr/bin/docker-compose /usr/libexec/docker/cli-plugins/docker-compose',