Skip to content

Failed to fetch google fonts while docker build, updated Docker image to lts-alpine3.23#626

Open
harmeetsingh-work wants to merge 1 commit intosrbhr:mainfrom
harmeetsingh-work:main
Open

Failed to fetch google fonts while docker build, updated Docker image to lts-alpine3.23#626
harmeetsingh-work wants to merge 1 commit intosrbhr:mainfrom
harmeetsingh-work:main

Conversation

@harmeetsingh-work
Copy link
Copy Markdown

@harmeetsingh-work harmeetsingh-work commented Jan 21, 2026

Description

While docker build getting error:

docker compose up -d

=> ERROR [frontend-builder 6/6] RUN npm run build                                                                              3.5s
------
 > [frontend-builder 6/6] RUN npm run build:
0.170
0.170 > resume-matcher-ui@1.0.0 build
0.170 > next build
0.170
0.551 Attention: Next.js now collects completely anonymous telemetry regarding usage.
0.551 This information is used to shape Next.js' roadmap and prioritize features.
0.552 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
0.552 https://nextjs.org/telemetry
0.552
0.558 ▲ Next.js 16.1.1 (Turbopack)
0.558 - Experiments (use with caution):
0.558   ✓ turbopackUseSystemTlsCerts
0.558
0.590   Creating an optimized production build ...
3.072 Turbopack build encountered 2 warnings:
3.072 [next]/internal/font/google/geist_efde1a47.module.css
3.072 Error while requesting resource
3.072 There was an issue establishing a connection while requesting https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap
3.072
3.072 Import trace:
3.072   Server Component:
3.072     [next]/internal/font/google/geist_efde1a47.module.css
3.072     [next]/internal/font/google/geist_efde1a47.js
3.072     ./app/layout.tsx
3.072
3.072
3.072 [next]/internal/font/google/space_grotesk_4f9f433b.module.css
3.072 Error while requesting resource
3.072 There was an issue establishing a connection while requesting https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap
3.072
3.072 Import trace:
3.072   Server Component:
3.072     [next]/internal/font/google/space_grotesk_4f9f433b.module.css
3.072     [next]/internal/font/google/space_grotesk_4f9f433b.js
3.072     ./app/layout.tsx
3.072
3.072
3.392
3.392 > Build error occurred
3.394 Error: Turbopack build failed with 2 errors:
3.394 [next]/internal/font/google/geist_efde1a47.module.css
3.394 next/font: error:
3.394 Failed to fetch `Geist` from Google Fonts.
3.394
3.394 Import trace:
3.394   Server Component:
3.394     [next]/internal/font/google/geist_efde1a47.module.css
3.394     [next]/internal/font/google/geist_efde1a47.js
3.394     ./app/layout.tsx
3.394
3.394
3.394 [next]/internal/font/google/space_grotesk_4f9f433b.module.css
3.394 next/font: error:
3.394 Failed to fetch `Space Grotesk` from Google Fonts.
3.394
3.394 Import trace:
3.394   Server Component:
3.394     [next]/internal/font/google/space_grotesk_4f9f433b.module.css
3.394     [next]/internal/font/google/space_grotesk_4f9f433b.js
3.394     ./app/layout.tsx
3.394
3.394
3.394     at ignore-listed frames
------
[+] build 0/1
 ⠙ Image resume-matcher Building                                                                                               12.2s
Dockerfile:24

--------------------

  22 |

  23 |     # Build the frontend

  24 | >>> RUN npm run build

  25 |

  26 |     # ============================================

--------------------

failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

copilot:summary

Type

  • Bug Fix
  • Feature Enhancement
  • Documentation Update
  • Code Refactoring
  • Other (please specify):

Proposed Changes

Updated node docker image to node:lts-alpine3.23 from node:22-slim in Dockerfile

How to Test

  1. docker compose up -d

Checklist

  • The code compiles successfully without any errors or warnings
  • The changes have been tested and verified
  • The documentation has been updated (if applicable)
  • The changes follow the project's coding guidelines and best practices
  • The commit messages are descriptive and follow the project's guidelines
  • All tests (if applicable) pass successfully
  • This pull request has been linked to the related issue (if applicable)

Additional Information

copilot:walkthrough


Summary by cubic

Switched the frontend builder base image from node:22-slim to node:lts-alpine3.23. This fixes Next.js build failures in Docker caused by Google Fonts fetch errors and restores a successful production build.

Written for commit 4e72909. Summary will update on new commits.

Updated node docker image to lts-alpine3.23, as facing google font fetching error while building with image lts-alpine3.23
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Jan 21, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Consider addressing before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
Dockerfile 7 Using floating lts tag instead of pinned version may cause non-reproducible builds

Details:

The change from node:22-slim to node:lts-alpine3.23 uses the lts tag which is a floating tag. When Node.js 24 becomes LTS (expected October 2025), this image will automatically change, potentially breaking builds.

Recommendation: Consider using a pinned version like node:22-alpine3.23 for reproducible builds while still getting the Alpine benefits.

Additional Notes

The Google Fonts fetch error in the PR description is typically a network/DNS issue during Docker build, not necessarily related to the base image. The Alpine image may work due to different network configuration (musl libc vs glibc, different DNS resolver). If the issue recurs, consider:

  1. Adding --network=host to the build
  2. Using local font files instead of Google Fonts
  3. Configuring DNS in the Docker build
Files Reviewed (1 file)
  • Dockerfile - 1 issue

Fix these issues in Kilo Cloud

# Stage 1: Build Frontend
# ============================================
FROM node:22-slim AS frontend-builder
FROM node:lts-alpine3.23 AS frontend-builder
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Using floating lts tag may cause non-reproducible builds

The lts tag is a floating tag that changes when a new Node.js version becomes LTS. When Node.js 24 becomes LTS, this image will automatically change, potentially breaking builds.

Suggested change
FROM node:lts-alpine3.23 AS frontend-builder
FROM node:22-alpine3.23 AS frontend-builder

This pins to Node 22 while still using the Alpine base that resolved the Google Fonts issue.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="Dockerfile">

<violation number="1" location="Dockerfile:7">
P2: Builder uses floating `node:lts` tag while runtime is pinned to Node 22, risking build/runtime mismatch and non-reproducible builds when LTS advances.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

# Stage 1: Build Frontend
# ============================================
FROM node:22-slim AS frontend-builder
FROM node:lts-alpine3.23 AS frontend-builder
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Builder uses floating node:lts tag while runtime is pinned to Node 22, risking build/runtime mismatch and non-reproducible builds when LTS advances.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Dockerfile, line 7:

<comment>Builder uses floating `node:lts` tag while runtime is pinned to Node 22, risking build/runtime mismatch and non-reproducible builds when LTS advances.</comment>

<file context>
@@ -4,7 +4,7 @@
 # Stage 1: Build Frontend
 # ============================================
-FROM node:22-slim AS frontend-builder
+FROM node:lts-alpine3.23 AS frontend-builder
 
 WORKDIR /app/frontend
</file context>
Suggested change
FROM node:lts-alpine3.23 AS frontend-builder
FROM node:22-alpine3.23 AS frontend-builder
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant