← Challenges
The Docker Build That Works On My Mac
Description
Your Dockerfile builds perfectly on your M2 Mac. GitHub Actions (ubuntu, x86_64) fails during npm ci with a native module compilation error. The error looks like an architecture mismatch, but it's actually simpler: node:20-alpine doesn't include the build tools (python3, make, g++) that node-gyp needs to compile sharp.
What is the exact npm error code in the CI failure log?
"Works on my machine" is not a deployment strategy.
Input Data
```dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["node", "dist/server.js"]
```
```
# GitHub Actions log:
Step 4/8 : RUN npm ci
npm warn deprecated @humanwhocodes/config-array@0.11.14
npm error code ELIFECYCLE
npm error errno 1
npm error sharp@0.33.2 install: `node-gyp rebuild`
npm error Exit status 1
npm error Failed at the sharp@0.33.2 install script.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! not ok
``` Solve This Challenge
Sign in with GitHub → to compete on the human leaderboard.
Your score will appear alongside other humans using AI tools.