diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22d2f0031de878..ff0cc768f7a502 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -562,10 +562,13 @@ jobs: run: pnpm build - name: Build docker - run: pnpm build:docker build --tries=3 + run: pnpm build:docker build --tries=3 --args '--load' env: LOG_LEVEL: debug + - name: Test docker + run: docker run -e LOG_LEVEL=debug --rm renovate/renovate --version + - name: Pack run: pnpm test-e2e:pack diff --git a/tools/docker.ts b/tools/docker.ts index 42cd36647d7435..734b473ba35e20 100644 --- a/tools/docker.ts +++ b/tools/docker.ts @@ -16,6 +16,7 @@ program 'delay between tries for docker build (eg. 5s, 10m, 1h)', '30s', ) + .option('--args ', 'additional arguments to pass to docker build') .action(async (opts) => { logger.info('Building docker images ...'); await bake('build', opts); diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index a079431cbab48b..27976361e56dce 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -59,9 +59,10 @@ COPY --link pnpm-lock.yaml ./ # set `npm_config_arch` for `prebuild-install` # set `npm_config_platform_arch` for `install-artifact-from-github` +ENV npm_config_arch=${ARCH} npm_config_platform_arch=${ARCH} + # only fetch deps from lockfile https://pnpm.io/cli/fetch RUN set -ex; \ - export npm_config_arch=${ARCH} npm_config_platform_arch=${ARCH}; \ corepack pnpm fetch --prod; \ true @@ -97,7 +98,7 @@ RUN ln -sf /usr/local/renovate/node /bin/node # ensure default base and cache directories exist. RUN mkdir -p /tmp/renovate/cache && \ - chmod -R 777 /tmp/renovate + chmod -R 777 /tmp/renovate # test RUN set -ex; \ diff --git a/tools/docker/bin/renovate-entrypoint.sh b/tools/docker/bin/renovate-entrypoint.sh index 7e0d39a1779887..6962881d0d39b8 100755 --- a/tools/docker/bin/renovate-entrypoint.sh +++ b/tools/docker/bin/renovate-entrypoint.sh @@ -1,15 +1,5 @@ #!/bin/bash -if [[ -f "/usr/local/etc/env" && -z "${CONTAINERBASE_ENV+x}" ]]; then - # shellcheck source=/dev/null - . /usr/local/etc/env -fi - -if [[ ! -d "/tmp/containerbase" ]]; then - # initialize all prepared tools - containerbase-cli init tool all -fi - if [[ "${1:0:1}" = '-' ]]; then # assume $1 is renovate flag set -- renovate "$@" @@ -20,4 +10,5 @@ if [[ ! -x "$(command -v "${1}")" ]]; then set -- renovate "$@" fi -exec dumb-init -- "$@" +# call the original entrypoint +exec docker-entrypoint.sh "$@"