Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): forward to default entrypoint #33819

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 "$@"
Loading