Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid alternative syntax for ENV instructions #823

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]