From e42396e7f29814b95f1627a9146565fc94885666 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 11 Oct 2023 15:49:50 +0200 Subject: [PATCH] feat!: drop distro from files --- .github/workflows/build.yml | 9 --------- Dockerfile | 22 +--------------------- README.md | 10 ++++------ bin/builder.sh | 9 +++------ bin/install-builder.sh | 25 ------------------------- 5 files changed, 8 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bee33f9..abb0946 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,15 +25,11 @@ jobs: strategy: fail-fast: false matrix: - distro: - - focal - - jammy arch: - x86_64 - aarch64 env: - DISTRO: ${{ matrix.distro }} # build target, name required by binary-builder ARCH: ${{ matrix.arch }} # build target, name required by binary-builder steps: @@ -45,8 +41,3 @@ jobs: command: binary-builder dry-run: ${{github.ref_name != 'main'}} token: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 - with: - name: ${{ env.DISTRO }} - path: .cache/*.tar.xz diff --git a/Dockerfile b/Dockerfile index 0975e72..253cca9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,4 @@ -#-------------------------------------- -# Ubuntu flavor -#-------------------------------------- -ARG DISTRO=focal - -#-------------------------------------- -# base images -#-------------------------------------- -FROM ubuntu:focal@sha256:33a5cc25d22c45900796a1aca487ad7a7cb09f09ea00b779e3b2026b4fc2faba as build-focal -FROM ubuntu:jammy@sha256:9b8dec3bf938bc80fbe758d856e96fdfab5f56c39d44b0cff351e847bb1b01ea as build-jammy - -FROM ghcr.io/containerbase/base:9.20.12@sha256:c2a0548b8f6a7fa82ca08586b7298fe05b8be5badcd94096cb2d4f88961c40e5 as containerbase - - -#-------------------------------------- -# builder images -#-------------------------------------- -FROM build-${DISTRO} as builder - -COPY --from=containerbase /usr/local/bin/ /usr/local/bin/ -COPY --from=containerbase /usr/local/containerbase /usr/local/containerbase +FROM ghcr.io/containerbase/base:9.20.12@sha256:c2a0548b8f6a7fa82ca08586b7298fe05b8be5badcd94096cb2d4f88961c40e5 ENTRYPOINT [ "dumb-init", "--", "builder.sh" ] diff --git a/README.md b/README.md index 8bd67ee..093c9ff 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Prebuild NodeJS releases used by [containerbase/base](https://github.com/contain Build the image ```bash -docker build -t builder --build-arg APT_PROXY=http://apt-proxy:3142 --build-arg DISTRO=focal . +docker build -t builder . ``` Test the image @@ -24,8 +24,6 @@ docker run --rm -it -v ${PWD}/.cache:/cache -e DEBURG=true builder 18.0.0 Optional environment variables -| Name | Description | Default | -| ----------- | ------------------------------------------------------------ | --------- | -| `DISTRO` | Set an ubuntu base distro, `focal` and `jammy` are supported | `focal` | -| `APT_PROXY` | Set an APT http proxy for installing build deps | `` | -| `DEBUG` | Show verbose php build output | `` | +| Name | Description | Default | +| ------- | ----------------------------- | --------- | +| `DEBUG` | Show verbose php build output | `` | diff --git a/bin/builder.sh b/bin/builder.sh index 84aa090..a3ae9a2 100755 --- a/bin/builder.sh +++ b/bin/builder.sh @@ -8,9 +8,6 @@ set -e # trim leading v TOOL_VERSION=${1#v} -# shellcheck disable=SC1091 -CODENAME=$(. /etc/os-release && echo "${VERSION_CODENAME}") - NAME=node ARCH=$(uname -p) farch=x64 @@ -37,7 +34,7 @@ function check_semver () { check_semver "${TOOL_VERSION}" -echo "Building ${NAME} ${TOOL_VERSION} for ${CODENAME}" +echo "Building ${NAME} ${TOOL_VERSION} for ${ARCH}" checksum_file=$(get_from_url "https://nodejs.org/dist/v${TOOL_VERSION}/SHASUMS256.txt") expected_checksum=$(grep "node-v${TOOL_VERSION}-linux-${farch}.tar.xz" "${checksum_file}" | cut -d' ' -f1) file=$(get_from_url \ @@ -56,5 +53,5 @@ tar -C "/usr/local/${NAME}/${TOOL_VERSION}" --strip 1 -xf "${file}" "/usr/local/${NAME}/${TOOL_VERSION}/bin/node" -v -echo "Compressing ${NAME} ${TOOL_VERSION} for ${CODENAME}-${ARCH}" -cp -f "${file}" "/cache/${NAME}-${TOOL_VERSION}-${CODENAME}-${ARCH}.tar.xz" +echo "Compressing ${NAME} ${TOOL_VERSION} for ${ARCH}" +cp -f "${file}" "/cache/${NAME}-${TOOL_VERSION}-${ARCH}.tar.xz" diff --git a/bin/install-builder.sh b/bin/install-builder.sh index 0cf011f..4827e7f 100755 --- a/bin/install-builder.sh +++ b/bin/install-builder.sh @@ -2,30 +2,5 @@ set -e - -echo "APT::Install-Recommends \"false\";" | tee -a /etc/apt/apt.conf.d/99containerbase.conf -echo "APT::Get::Upgrade \"false\";" | tee -a /etc/apt/apt.conf.d/99containerbase.conf -echo "APT::Get::Install-Suggests \"false\";" | tee -a /etc/apt/apt.conf.d/99containerbase.conf - -if [[ -n "${APT_PROXY}" ]]; then - echo "Acquire::http::proxy \"${APT_PROXY}\";" | tee -a /etc/apt/apt.conf.d/99containerbase-proxy.conf -fi - -export DEBIAN_FRONTEND=noninteractive - -apt-get update -q -apt-get install -q -y \ - ca-certificates \ - curl \ - dumb-init \ - xz-utils \ - ; - mkdir -p /usr/local/node /cache -#-------------------------------- -# cleanup -#-------------------------------- -if [[ -n "${APT_PROXY}" ]]; then - rm -f /etc/apt/apt.conf.d/99containerbase-proxy.conf -fi