Skip to content

Commit 9f6703f

Browse files
committed
Pull Request 1 of 2 (this is for master branch)
Running [hadolint](https://github.com/hadolint/hadolint) against a NodeRed Dockerfile generated by IOTstack produces these messages: ``` Dockerfile:2 DL3002 warning: Last USER should not be root Dockerfile:3 DL3017 error: Do not use apk upgrade ``` This Pull Request makes the following changes to the Dockerfile template: * makes the default build select node.js version 12 (instead of version 10). * coalesces the `RUN apk` commands into a single line, omitting the `apk upgrade`. * restores the current user to "node-red" after the `apk` commands rather than leaving it at root. > I added the `RUN apk` commands and `USER root` directive so I should probably be the one to correct these mistakes. References: * [docker docs - how to keep your images small](https://docs.docker.com/develop/dev-best-practices/#how-to-keep-your-images-small) * [docker docs - dockerfile best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run) * [sysdig - dockerfile-best-practices](https://sysdig.com/blog/dockerfile-best-practices/)
1 parent fbb9f27 commit 9f6703f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
FROM nodered/node-red:latest
1+
FROM nodered/node-red:latest-12
22
USER root
3-
RUN apk update
4-
RUN apk upgrade
5-
RUN apk add --no-cache eudev-dev
3+
RUN apk update && apk add --no-cache eudev-dev
4+
USER node-red
65

76
%run npm install modules list%

0 commit comments

Comments
 (0)