-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Current behavior
Building the app in https://github.com/docker/getting-started-app using the Dockerfile described in https://docs.docker.com/get-started/workshop/02_our_app/ causes a Node.js "[DEP0169] DeprecationWarning"
(node:1) [DEP0169] DeprecationWarning:
url.parse()behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued forurl.parse()vulnerabilities.
(Usenode --trace-deprecation ...to show where the warning was created)
Desired behavior
Following the instructions in https://docs.docker.com/get-started/workshop/ should not cause any Node.js deprecation warning.
The example should use a supported package manager.
Test code to reproduce
git clone https://github.com/docker/getting-started-app.git
cd getting-started-app
cat > Dockerfile <<EOT
# syntax=docker/dockerfile:1
FROM node:lts-alpine
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]
EXPOSE 3000
EOT
docker build --progress plain -t getting-started . --no-cacheDebug Logs
$ docker build --progress plain -t getting-started . --no-cache
#0 building with "desktop-linux" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 183B done
#1 DONE 0.0s
#2 resolve image config for docker-image://docker.io/docker/dockerfile:1
#2 DONE 0.2s
#3 docker-image://docker.io/docker/dockerfile:1@sha256:b6afd42430b15f2d2a4c5a02b919e98a525b785b1aaff16747d2f623364e39b6
#3 CACHED
#4 [internal] load metadata for docker.io/library/node:lts-alpine
#4 DONE 0.2s
#5 [internal] load .dockerignore
#5 transferring context: 66B done
#5 DONE 0.0s
#6 [1/4] FROM docker.io/library/node:lts-alpine@sha256:c921b97d4b74f51744057454b306b418cf693865e73b8100559189605f6955b8
#6 DONE 0.0s
#7 [2/4] WORKDIR /app
#7 CACHED
#8 [internal] load build context
#8 transferring context: 4.47kB done
#8 DONE 0.0s
#9 [3/4] COPY . .
#9 DONE 0.1s
#10 [4/4] RUN yarn install --production
#10 0.635 yarn install v1.22.22
#10 0.699 [1/4] Resolving packages...
#10 0.836 (node:1) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
#10 0.836 (Use `node --trace-deprecation ...` to show where the warning was created)
#10 0.840 [2/4] Fetching packages...
#10 6.859 [3/4] Linking dependencies...
#10 7.630 [4/4] Building fresh packages...
#10 8.220 Done in 7.59s.
#10 DONE 8.4s
#11 exporting to image
#11 exporting layers
#11 exporting layers 1.0s done
#11 writing image sha256:1e9532557e915b9cfa6023dfd72d8facf7585a98d04b1a0e6571ec0bbb306315 done
#11 naming to docker.io/library/getting-started done
#11 DONE 1.1s
Other
The Node.js [DEP0169] DeprecationWarning: url.parse() is a known issue for Yarn v1 Classic - see yarnpkg/yarn#9210.
Considering that Yarn v1 Classic is unsupported since the year 2020, and the last release yarn@1.22.22 was in March 2024, there can be no expectation that Yarn v1 Classic will ever resolve the deprecation.
The example should migrate to a supported package manager instead. Installing with npm instead of yarn, for example, does not provoke the Node.js [DEP0169] DeprecationWarning.
Note also the related issue #93 concerning a need to refresh dependencies in the example app.
cc: @karlhorky