[BUG] docker image build failed with TLS ServerName to an IP address is not permitted by RFC 6066
- Dominant language
- JavaScript
- Stars
- 39.5k
- Forks
- 3.2k
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 16
Description
**Describe the bug**
Can not build docker image via release 1.21.
**To Reproduce**
Steps to reproduce the behavior:
1. docker build -t drawdb .
2. Will get error as below
```shell
[+] Building 13.2s (8/10) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 514B 0.0s
=> [internal] load metadata for docker.io/library/node:20-alpine 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 465B 0.0s
=> [1/6] FROM docker.io/library/node:20-alpine 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 14.36kB 0.0s
=> CACHED [2/6] WORKDIR /app 0.0s
=> CACHED [3/6] COPY package*.json ./ 0.0s
=> ERROR [4/6] RUN npm ci 13.1s
------
> [4/6] RUN npm ci:
0.455 (node:1) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
0.455 (Use `node --trace-deprecation ...` to show where the warning was created)
12.99 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-05T13_37_00_499Z-debug-0.log
------
Dockerfile:5
--------------------
3 | WORKDIR /app
4 | COPY package*.json ./
5 | >>> RUN npm ci
6 | COPY . .
7 | RUN npm run build
--------------------
ERROR: failed to solve: process "/bin/sh -c npm ci" did not complete successfully: exit code: 1
```
**Expected behavior**
The docker image with version 1.2.1 should be created.
Contributor guide
Research direction
Start with Dockerfile and package*.json, then run `docker build -t drawdb .` to reproduce the failure at `RUN npm ci`. Inspect the npm debug log and the TLS ServerName warning to identify why dependency installation exits nonzero. Done means the Docker image for the reported release builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, dockerfile, javascript, node.js
- Domain
- build-system, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100