Skip to content

Commit

Permalink
feat(docker): forward to default entrypoint (#33819)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice authored Jan 24, 2025
1 parent bdf3d1d commit 55b8d0e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tools/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ program
'delay between tries for docker build (eg. 5s, 10m, 1h)',
'30s',
)
.option('--args <args...>', 'additional arguments to pass to docker build')
.action(async (opts) => {
logger.info('Building docker images ...');
await bake('build', opts);
Expand Down
5 changes: 3 additions & 2 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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; \
Expand Down
13 changes: 2 additions & 11 deletions tools/docker/bin/renovate-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
Expand All @@ -20,4 +10,5 @@ if [[ ! -x "$(command -v "${1}")" ]]; then
set -- renovate "$@"
fi

exec dumb-init -- "$@"
# call the original entrypoint
exec docker-entrypoint.sh "$@"

0 comments on commit 55b8d0e

Please sign in to comment.