Skip to content

Commit

Permalink
tidy up dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Oct 1, 2019
1 parent 3282a39 commit b143cde
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
22 changes: 11 additions & 11 deletions .docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ COPY package.json .
FROM base AS build

# Install Build tools
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python

RUN npm install --unsafe-perm --no-update-notifier --only=production
RUN /tmp/remove_native_gpio.sh
RUN cp -R node_modules prod_node_modules
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python && \
npm install --unsafe-perm --no-update-notifier --only=production && \
/tmp/remove_native_gpio.sh && \
cp -R node_modules prod_node_modules

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

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

# Install devtools & Clean up
RUN /tmp/install_devtools.sh && \
rm /tmp/* && rm /usr/bin/qemu-$QEMU_ARCH-static
# Chown, install devtools & Clean up
RUN chown -R node-red:node-red /usr/src/node-red && \
/tmp/install_devtools.sh && \
rm /tmp/* && \
rm /usr/bin/qemu-$QEMU_ARCH-static

USER node-red

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

USER node-red

# Expose the listening port of node-red
EXPOSE 1880

Expand Down
24 changes: 13 additions & 11 deletions docker-custom/Dockerfile.custom
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ COPY package.json .
FROM base AS build

# Install Build tools
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python

RUN npm install --unsafe-perm --no-update-notifier --only=production
RUN /tmp/remove_native_gpio.sh
RUN cp -R node_modules prod_node_modules
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python && \
npm install --unsafe-perm --no-update-notifier --only=production && \
/tmp/remove_native_gpio.sh && \
cp -R node_modules prod_node_modules

#### Stage RELEASE #####################################################################################################
FROM base AS RELEASE
Expand All @@ -51,10 +50,10 @@ ARG TAG_SUFFIX=default

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

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

# Install devtools & Clean up
RUN /tmp/install_devtools.sh && \
rm /tmp/* && rm /usr/bin/qemu-$QEMU_ARCH-static
# Chown, install devtools & Clean up
RUN chown -R node-red:node-red /usr/src/node-red && \
/tmp/install_devtools.sh && \
rm /tmp/* && \
rm /usr/bin/qemu-$QEMU_ARCH-static

USER node-red

# Env variables
ENV NODE_RED_VERSION=$NODE_RED_VERSION
Expand Down

0 comments on commit b143cde

Please sign in to comment.