Skip to content

Commit b143cde

Browse files
author
Dave Conway-Jones
committed
tidy up dockerfiles
1 parent 3282a39 commit b143cde

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

.docker/Dockerfile.alpine

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ COPY package.json .
3838
FROM base AS build
3939

4040
# Install Build tools
41-
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python
42-
43-
RUN npm install --unsafe-perm --no-update-notifier --only=production
44-
RUN /tmp/remove_native_gpio.sh
45-
RUN cp -R node_modules prod_node_modules
41+
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python && \
42+
npm install --unsafe-perm --no-update-notifier --only=production && \
43+
/tmp/remove_native_gpio.sh && \
44+
cp -R node_modules prod_node_modules
4645

4746
#### Stage RELEASE #####################################################################################################
4847
FROM base AS RELEASE
@@ -68,11 +67,14 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \
6867
authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan"
6968

7069
COPY --from=build /usr/src/node-red/prod_node_modules ./node_modules
71-
RUN chown -R node-red:node-red /usr/src/node-red
7270

73-
# Install devtools & Clean up
74-
RUN /tmp/install_devtools.sh && \
75-
rm /tmp/* && rm /usr/bin/qemu-$QEMU_ARCH-static
71+
# Chown, install devtools & Clean up
72+
RUN chown -R node-red:node-red /usr/src/node-red && \
73+
/tmp/install_devtools.sh && \
74+
rm /tmp/* && \
75+
rm /usr/bin/qemu-$QEMU_ARCH-static
76+
77+
USER node-red
7678

7779
# Env variables
7880
ENV NODE_RED_VERSION=$NODE_RED_VERSION
@@ -82,8 +84,6 @@ ENV NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules
8284
# User configuration directory volume
8385
VOLUME ["/data"]
8486

85-
USER node-red
86-
8787
# Expose the listening port of node-red
8888
EXPOSE 1880
8989

docker-custom/Dockerfile.custom

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ COPY package.json .
3434
FROM base AS build
3535

3636
# Install Build tools
37-
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python
38-
39-
RUN npm install --unsafe-perm --no-update-notifier --only=production
40-
RUN /tmp/remove_native_gpio.sh
41-
RUN cp -R node_modules prod_node_modules
37+
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python && \
38+
npm install --unsafe-perm --no-update-notifier --only=production && \
39+
/tmp/remove_native_gpio.sh && \
40+
cp -R node_modules prod_node_modules
4241

4342
#### Stage RELEASE #####################################################################################################
4443
FROM base AS RELEASE
@@ -51,10 +50,10 @@ ARG TAG_SUFFIX=default
5150

5251
LABEL org.label-schema.build-date=${BUILD_DATE} \
5352
org.label-schema.docker.dockerfile=".docker/Dockerfile.alpine" \
54-
org.label-schema.license="Apache License 2.0" \
53+
org.label-schema.license="Apache-2.0" \
5554
org.label-schema.name="Node-RED" \
5655
org.label-schema.version=${BUILD_VERSION} \
57-
org.label-schema.description="Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways." \
56+
org.label-schema.description="Low-code programming for event-driven applications." \
5857
org.label-schema.url="https://nodered.org" \
5958
org.label-schema.vcs-ref=${BUILD_REF} \
6059
org.label-schema.vcs-type="Git" \
@@ -63,11 +62,14 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \
6362
authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan"
6463

6564
COPY --from=build /usr/src/node-red/prod_node_modules ./node_modules
66-
RUN chown -R node-red:node-red /usr/src/node-red
6765

68-
# Install devtools & Clean up
69-
RUN /tmp/install_devtools.sh && \
70-
rm /tmp/* && rm /usr/bin/qemu-$QEMU_ARCH-static
66+
# Chown, install devtools & Clean up
67+
RUN chown -R node-red:node-red /usr/src/node-red && \
68+
/tmp/install_devtools.sh && \
69+
rm /tmp/* && \
70+
rm /usr/bin/qemu-$QEMU_ARCH-static
71+
72+
USER node-red
7173

7274
# Env variables
7375
ENV NODE_RED_VERSION=$NODE_RED_VERSION

0 commit comments

Comments
 (0)