From ef904444e4cb58e9ca08c7f9f7a435cf4b076bb9 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sun, 17 Dec 2023 06:13:34 +0800 Subject: [PATCH] Revert "Update Docker Dompose plugin to 2.23.3 (#303)" This reverts commit 6a3eebfd5791b618b7325a4d7505bf64b2e51da9. --- docker/Base.Dockerfile | 15 +----------- extra/download-docker-compose.ts | 39 -------------------------------- 2 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 extra/download-docker-compose.ts diff --git a/docker/Base.Dockerfile b/docker/Base.Dockerfile index b7e0539..47dabaf 100644 --- a/docker/Base.Dockerfile +++ b/docker/Base.Dockerfile @@ -2,14 +2,6 @@ FROM node:18.17.1-bookworm-slim ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" - - -# TARGETPLATFORM: linux/amd64, linux/arm64, linux/arm/v7 -ARG TARGETPLATFORM - -# TARGETARCH: amd64, arm64, arm/v7 -ARG TARGETARCH - RUN apt update && apt install --yes --no-install-recommends \ curl \ ca-certificates \ @@ -26,12 +18,7 @@ RUN apt update && apt install --yes --no-install-recommends \ && apt update \ && apt --yes --no-install-recommends install \ docker-ce-cli \ + docker-compose-plugin \ && rm -rf /var/lib/apt/lists/* \ && npm install pnpm -g \ && pnpm install -g tsx - -# Download docker-compose, as the repo's docker-compose is not up-to-date. -COPY ./extra/download-docker-compose.ts ./extra/download-docker-compose.ts -ARG DOCKER_COMPOSE_VERSION="2.23.3" -RUN tsx ./extra/download-docker-compose.ts ${TARGETPLATFORM} ${DOCKER_COMPOSE_VERSION} \ - && docker compose version diff --git a/extra/download-docker-compose.ts b/extra/download-docker-compose.ts deleted file mode 100644 index 0a18531..0000000 --- a/extra/download-docker-compose.ts +++ /dev/null @@ -1,39 +0,0 @@ -import fs from "fs"; - -async function main() { - // TARGETPLATFORM - const targetPlatform = process.argv[2]; - - // Docker Compose version - const dockerComposeVersion = process.argv[3]; - - // Arch - let arch = ""; - - if (targetPlatform === "linux/amd64") { - arch = "x86_64"; - } else if (targetPlatform === "linux/arm64") { - arch = "aarch64"; - } else if (targetPlatform === "linux/arm/v7") { - arch = "armv7"; - } else { - throw new Error(`Unknown target platform: ${targetPlatform}`); - } - - // mkdir -p /root/.docker/cli-plugins - fs.mkdirSync("/root/.docker/cli-plugins", { recursive: true }); - - // Download URL - const url = `https://github.com/docker/compose/releases/download/v${dockerComposeVersion}/docker-compose-linux-${arch}`; - - console.log(url); - - // Download docker-compose using fetch api, to "/root/.docker/cli-plugins/docker-compose" - const buffer = await (await fetch(url)).arrayBuffer(); - fs.writeFileSync("/root/.docker/cli-plugins/docker-compose", Buffer.from(buffer)); - - // chmod +x /root/.docker/cli-plugins/docker-compose - fs.chmodSync("/root/.docker/cli-plugins/docker-compose", 0o111); -} - -main();