-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (47 loc) · 1.66 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#use armv7hf compatible base image
FROM balenalib/armv7hf-debian:buster-20191223
#dynamic build arguments coming from the /hook/build file
ARG BUILD_DATE
ARG VCS_REF
#metadata labels
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/HilscherAutomation/netPI-nodered-fram" \
org.label-schema.vcs-ref=$VCS_REF
#enable cross compiling (comment out next line if built on Raspberry Pi)
RUN [ "cross-build-start" ]
#version
ENV HILSCHERNETPI_NODERED_FRAM_VERSION 1.2.0
#labeling
LABEL maintainer="netpi@hilscher.com" \
version=$HILSCHERNETPI_NODERED_FRAM_VERSION \
description="Node-RED including FRAM nodes"
#copy files
COPY "./init.d/*" /etc/init.d/
COPY "./node-red-contrib-fram/*" /tmp/
#do installation
RUN apt-get update \
&& apt-get install curl build-essential python-dev \
#install node.js
&& curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - \
&& apt-get install -y nodejs \
#install Node-RED
&& npm install -g --unsafe-perm node-red@1.0.3 \
#install nodes
&& mkdir /usr/lib/node_modules/node-red-contrib-fram \
&& mv /tmp/fram.js /tmp/fram.html /tmp/package.json -t /usr/lib/node_modules/node-red-contrib-fram \
&& cd /usr/lib/node_modules/node-red-contrib-fram \
&& npm install \
#clean up
&& rm -rf /tmp/* \
&& apt-get remove curl \
&& apt-get -yqq autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
#set the entrypoint
ENTRYPOINT ["/etc/init.d/entrypoint.sh"]
#Node-RED Port
EXPOSE 1880
#set STOPSGINAL
STOPSIGNAL SIGTERM
#stop processing ARM emulation (comment out next line if built on Raspberry)
RUN [ "cross-build-end" ]