Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit 6d49996

Browse files
authored
fix: update Dockerfile yarn installation to fix docker builds (#1)
I ran into two yarn-related issues when running docker builds. First build failed with an error related to git: ``` > [build 5/15] RUN SKIP_POSTINSTALL=1 yarn install: 0.396 yarn install v1.22.22 0.477 [1/4] Resolving packages... 0.497 warning Resolution field "[email protected]" is incompatible with requested version "[email protected]" 0.656 warning Resolution field "@electron/[email protected]" is incompatible with requested version "@electron/[email protected]" 0.781 [2/4] Fetching packages... 8.047 error Couldn't find the binary git ``` I resolved this issue by installing `git` before running `yarn install`. --- After this is resolved, now there's a later failure in `yarn install`: ``` 38.69 [4/4] Building fresh packages... 40.02 error /usr/src/app/node_modules/postinstall-postinstall: Command failed. 40.02 Exit code: 1 40.02 Command: node ./run.js 40.02 Arguments: 40.02 Directory: /usr/src/app/node_modules/postinstall-postinstall 40.02 Output: 40.02 ✘ [ERROR] Could not resolve "/usr/src/app/redisinsight/ui/vite.config.mjs" ``` I resolved this issue by using the `yarn install --ignore-scripts` option, which will correctly stop the postinstall scripts from running. ### Test Plan Locally I ran docker build and confirmed it now works: ``` $ lsb_release -a Distributor ID: Ubuntu Description: Ubuntu 24.04.2 LTS Release: 24.04 Codename: noble $ docker build . ... => => writing image sha256:91f310a1dd1781dba565af73f77f78da6b14fd2411e3e56257f68030663111c3 0.0s ``` Fixes redis#4404
1 parent b551c6a commit 6d49996

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ FROM node:20.14-alpine as build
1212
RUN apk update && apk add --no-cache --virtual .gyp \
1313
python3 \
1414
make \
15-
g++
15+
g++ \
16+
git
1617

1718
# set workdir
1819
WORKDIR /usr/src/app
1920

2021
# restore node_modules for front-end
2122
COPY package.json yarn.lock tsconfig.json ./
22-
RUN SKIP_POSTINSTALL=1 yarn install
23+
RUN yarn install --ignore-scripts
2324

2425
# prepare backend by copying scripts/configs and installing node modules
2526
# this is required to build the static assets

0 commit comments

Comments
 (0)