Skip to content

Commit

Permalink
Avoid alternative syntax for ENV instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c committed Mar 30, 2022
1 parent d30f881 commit 3ab94f2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .changeset/six-ladybugs-notice.md
Original file line number Diff line number Diff line change
@@ -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
```
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
6 changes: 3 additions & 3 deletions template/express-rest-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions template/koa-rest-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 3ab94f2

Please sign in to comment.