Skip to content

Commit 9097992

Browse files
RaymondMouthaandceejay
authored andcommitted
node-red owner fix (#137)
1 parent 66801f5 commit 9097992

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

docker-custom/Dockerfile.custom

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,15 @@ RUN set -ex && \
2727
# Set work directory
2828
WORKDIR /usr/src/node-red
2929

30-
# Run as node-red user
31-
USER node-red
3230
# package.json contains Node-RED NPM module and node dependencies
3331
COPY package.json .
3432

3533
#### Stage BUILD #######################################################################################################
3634
FROM base AS build
3735

38-
USER root
3936
# Install Build tools
4037
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python
4138

42-
USER node-red
4339
RUN npm install --only=production
4440
RUN /tmp/remove_native_gpio.sh
4541
RUN cp -R node_modules prod_node_modules
@@ -66,13 +62,14 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \
6662
org.label-schema.arch=${ARCH} \
6763
authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan"
6864

69-
USER root
7065
# Install devtools & Clean up
7166
RUN /tmp/install_devtools.sh && \
7267
rm /tmp/*
7368

74-
USER node-red
7569
COPY --from=build /usr/src/node-red/prod_node_modules ./node_modules
70+
RUN chown -R node-red:node-red /usr/src/node-red
71+
72+
USER node-red
7673

7774
# Env variables
7875
ENV NODE_RED_VERSION=$NODE_RED_VERSION

0 commit comments

Comments
 (0)