From 3ab94f2f5e23c11f6d60a75d0ffdefead04b3c84 Mon Sep 17 00:00:00 2001 From: Ryan Ling Date: Thu, 31 Mar 2022 01:30:38 +1100 Subject: [PATCH] Avoid alternative syntax for ENV instructions --- .changeset/six-ladybugs-notice.md | 12 ++++++++++++ CHANGELOG.md | 2 +- template/express-rest-api/Dockerfile | 6 +++--- template/koa-rest-api/Dockerfile | 6 +++--- 4 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 .changeset/six-ladybugs-notice.md diff --git a/.changeset/six-ladybugs-notice.md b/.changeset/six-ladybugs-notice.md new file mode 100644 index 000000000..65ef7b0eb --- /dev/null +++ b/.changeset/six-ladybugs-notice.md @@ -0,0 +1,12 @@ +--- +'skuba': patch +--- + +template/\*-rest-api: Avoid alternative syntax for ENV instructions + +Omitting the `=` symbol in ENV instructions [is discouraged and may be disallowed in future](https://docs.docker.com/engine/reference/builder/#env). + +```diff +- ENV NODE_ENV production ++ ENV NODE_ENV=production +``` diff --git a/CHANGELOG.md b/CHANGELOG.md index 307f58516..98a96f11c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,7 +113,7 @@ + FROM gcr.io/distroless/nodejs:16 AS runtime + # https://nodejs.org/api/cli.html#cli_node_options_options - + ENV NODE_OPTIONS --enable-source-maps + + ENV NODE_OPTIONS=--enable-source-maps ``` For a Serverless Lambda application, update your `serverless.yml`: diff --git a/template/express-rest-api/Dockerfile b/template/express-rest-api/Dockerfile index 131346e64..a29bc103a 100644 --- a/template/express-rest-api/Dockerfile +++ b/template/express-rest-api/Dockerfile @@ -25,13 +25,13 @@ COPY --from=build /workdir/lib lib COPY --from=deps /workdir/node_modules node_modules -ENV NODE_ENV production +ENV NODE_ENV=production # https://nodejs.org/api/cli.html#cli_node_options_options -ENV NODE_OPTIONS --enable-source-maps +ENV NODE_OPTIONS=--enable-source-maps ARG PORT=8001 -ENV PORT ${PORT} +ENV PORT=${PORT} EXPOSE ${PORT} CMD ["lib/listen.js"] diff --git a/template/koa-rest-api/Dockerfile b/template/koa-rest-api/Dockerfile index ba01e4ec0..85d41ee48 100644 --- a/template/koa-rest-api/Dockerfile +++ b/template/koa-rest-api/Dockerfile @@ -25,13 +25,13 @@ COPY --from=build /workdir/lib lib COPY --from=deps /workdir/node_modules node_modules -ENV NODE_ENV production +ENV NODE_ENV=production # https://nodejs.org/api/cli.html#cli_node_options_options -ENV NODE_OPTIONS --enable-source-maps +ENV NODE_OPTIONS=--enable-source-maps ARG PORT=8001 -ENV PORT ${PORT} +ENV PORT=${PORT} EXPOSE ${PORT} CMD ["--require", "./lib/tracing.js", "./lib/listen.js"]