Skip to content

Commit

Permalink
fix(corepack): resolve corepack key id issue
Browse files Browse the repository at this point in the history
  • Loading branch information
burritobill committed Feb 3, 2025
1 parent 6c719b7 commit 0afb45a
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ ARG TARGETPLATFORM
ARG TARGETARCH
ARG BUILDPLATFORM

RUN set -ex
echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
uname -a
true
RUN set -ex; \
echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"; \
uname -a; \
true

# replace `amd64` with `x86_64` for `node`
ENV ARCH=${TARGETARCH/amd64/x86_64}
ENV ARCH=${ARCH/arm64/aarch64}

# fetch static node binary
RUN set -ex
ver=$(node --version)
ver=${ver:1} \
temp_dir="$(mktemp -d)"
curl -fsSL "https://github.com/containerbase/node-prebuild/releases/download/${ver}/node-${ver}-${ARCH}.tar.xz" -o ${temp_dir}/node.tar.xz
bsdtar --strip 1 -C ${temp_dir} -xf ${temp_dir}/node.tar.xz
cp ${temp_dir}/bin/node ./node
true
RUN set -ex; \
ver=$(node --version); ver=${ver:1} \
temp_dir="$(mktemp -d)"; \
curl -fsSL "https://github.com/containerbase/node-prebuild/releases/download/${ver}/node-${ver}-${ARCH}.tar.xz" -o ${temp_dir}/node.tar.xz; \
bsdtar --strip 1 -C ${temp_dir} -xf ${temp_dir}/node.tar.xz; \
cp ${temp_dir}/bin/node ./node; \
true

# fetch npm packages
ENV CI=1 npm_config_modules_cache_max_age=0 \
npm_config_loglevel=info


# replace `amd64` with `x64` for `node`
ENV ARCH=${TARGETARCH/amd64/x64}

Expand All @@ -66,16 +66,16 @@ COPY --link pnpm-lock.yaml ./
ENV npm_config_arch=${ARCH} npm_config_platform_arch=${ARCH}

# only fetch deps from lockfile https://pnpm.io/cli/fetch
RUN set -ex
corepack pnpm fetch --prod
true
RUN set -ex; \
corepack pnpm fetch --prod; \
true

COPY --link . ./

# install npm packages
RUN set -ex
corepack pnpm install --prod --offline --ignore-scripts
true
RUN set -ex; \
corepack pnpm install --prod --offline --ignore-scripts; \
true

# --------------------------------------
# final image
Expand All @@ -101,15 +101,15 @@ COPY --link --from=build --chown=root:root /usr/local/renovate/ /usr/local/renov
RUN ln -sf /usr/local/renovate/node /bin/node

# ensure default base and cache directories exist.
RUN mkdir -p /tmp/renovate/cache &&
RUN mkdir -p /tmp/renovate/cache && \
chmod -R 777 /tmp/renovate

# test
RUN set -ex
renovate --version
pushd /usr/local/renovate/
node -e "new require('re2')('.*').exec('test');new require('better-sqlite3')(':memory:')"
true
RUN set -ex; \
renovate --version; \
pushd /usr/local/renovate/; \
node -e "new require('re2')('.*').exec('test');new require('better-sqlite3')(':memory:')"; \
true

LABEL \
org.opencontainers.image.version="${RENOVATE_VERSION}" \
Expand Down

0 comments on commit 0afb45a

Please sign in to comment.