Skip to content

Commit a615938

Browse files
committed
Changed to Debian 10 Buster
1 parent f0a26b6 commit a615938

File tree

3 files changed

+97
-79
lines changed

3 files changed

+97
-79
lines changed

Dockerfile

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#use armv7hf compatible base image
2-
FROM balenalib/armv7hf-debian:stretch
2+
FROM balenalib/armv7hf-debian:buster
33

44
#dynamic build arguments coming from the /hook/build file
55
ARG BUILD_DATE
@@ -10,11 +10,11 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
1010
org.label-schema.vcs-url="https://github.com/HilscherAutomation/netPI-raspbian" \
1111
org.label-schema.vcs-ref=$VCS_REF
1212

13-
#enable building ARM container on x86 machinery on the web (comment out next line if built on Raspberry)
13+
#enable cross compiling (comment out next line if built on Raspberry Pi)
1414
RUN [ "cross-build-start" ]
1515

1616
#version
17-
ENV HILSCHERNETPI_RASPBIAN_VERSION 1.0.2
17+
ENV HILSCHERNETPI_RASPBIAN_VERSION 1.1.0
1818

1919
#labeling
2020
LABEL maintainer="netpi@hilscher.com" \
@@ -29,45 +29,41 @@ ENV PASSWD=raspberry
2929
COPY "./init.d/*" /etc/init.d/
3030

3131
RUN apt-get update \
32-
&& apt-get install wget \
33-
&& wget https://archive.raspbian.org/raspbian.public.key -O - | apt-key add - \
34-
&& echo 'deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi' | tee -a /etc/apt/sources.list \
35-
&& wget -O - http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | sudo apt-key add - \
36-
&& echo 'deb http://archive.raspberrypi.org/debian/ stretch main ui' | tee -a /etc/apt/sources.list.d/raspi.list \
37-
&& apt-get update \
38-
&& apt-get install -y openssh-server \
39-
&& mkdir /var/run/sshd \
40-
# && sed -i -e 's;#Port 22;Port 23;' /etc/ssh/sshd_config \ #Comment in if SSH port other than 22 is needed (22->23)
41-
&& sed -i 's@#force_color_prompt=yes@force_color_prompt=yes@g' -i /etc/skel/.bashrc \
42-
&& useradd --create-home --shell /bin/bash pi \
43-
&& echo $USER:$PASSWD | chpasswd \
44-
&& adduser $USER sudo \
45-
&& echo $USER " ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/010_pi-nopasswd \
46-
&& groupadd spi \
47-
&& groupadd gpio \
48-
&& adduser $USER dialout \
49-
&& adduser $USER cdrom \
50-
&& adduser $USER audio \
51-
&& adduser $USER video \
52-
&& adduser $USER plugdev \
53-
&& adduser $USER games \
54-
&& adduser $USER users \
55-
&& adduser $USER input \
56-
&& adduser $USER spi \
57-
&& adduser $USER gpio \
58-
&& apt-get install -y --no-install-recommends \
32+
&& apt-get install wget \
33+
&& wget https://archive.raspbian.org/raspbian.public.key -O - | apt-key add - \
34+
&& echo 'deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi' | tee -a /etc/apt/sources.list \
35+
&& wget -O - http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | sudo apt-key add - \
36+
&& echo 'deb http://archive.raspberrypi.org/debian/ buster main ui' | tee -a /etc/apt/sources.list.d/raspi.list \
37+
&& apt-get update \
38+
&& apt-get install -y openssh-server \
39+
&& mkdir /var/run/sshd \
40+
# && sed -i -e 's;#Port 22;Port 23;' /etc/ssh/sshd_config \ #Comment in if SSH port other than 22 is needed (22->23)
41+
&& sed -i 's@#force_color_prompt=yes@force_color_prompt=yes@g' -i /etc/skel/.bashrc \
42+
&& useradd --create-home --shell /bin/bash pi \
43+
&& echo $USER:$PASSWD | chpasswd \
44+
&& adduser $USER sudo \
45+
&& groupadd spi \
46+
&& groupadd gpio \
47+
&& adduser $USER dialout \
48+
&& adduser $USER cdrom \
49+
&& adduser $USER audio \
50+
&& adduser $USER video \
51+
&& adduser $USER plugdev \
52+
&& adduser $USER games \
53+
&& adduser $USER users \
54+
&& adduser $USER input \
55+
&& adduser $USER spi \
56+
&& adduser $USER gpio \
57+
&& apt-get install -y --no-install-recommends \
5958
less \
6059
kmod \
6160
nano \
6261
net-tools \
6362
ifupdown \
6463
iputils-ping \
65-
i2c-tools \
6664
usbutils \
6765
build-essential \
68-
git \
6966
python \
70-
aptitude \
7167
unzip \
7268
info \
7369
htop \
@@ -85,13 +81,11 @@ RUN apt-get update \
8581
avahi-daemon \
8682
bash-completion \
8783
bind9-host \
88-
blends-tasks \
8984
bluez \
9085
bsdmainutils \
9186
cifs-utils \
9287
console-setup \
9388
console-setup-linux \
94-
dh-python \
9589
cpio \
9690
crda \
9791
cron \
@@ -110,21 +104,16 @@ RUN apt-get update \
110104
dphys-swapfile \
111105
groff-base \
112106
hardlink \
113-
initramfs-tools \
114-
initramfs-tools-core \
115107
iso-codes \
116108
keyutils \
117-
klibc-utils \
118109
locales \
119110
logrotate \
120111
lsb-release \
121112
lua5.1 \
122113
luajit \
123-
makedev \
124114
man-db \
125115
manpages \
126116
manpages-dev \
127-
mountall \
128117
ncdu \
129118
ncurses-term \
130119
netcat-openbsd \
@@ -133,16 +122,12 @@ RUN apt-get update \
133122
openresolv \
134123
paxctld \
135124
pkg-config \
136-
plymouth \
137125
policykit-1 \
138-
rename \
139126
rfkill \
140127
rpcbind \
141-
sgml-base \
142128
shared-mime-info \
143129
ssh \
144130
strace \
145-
tcpd \
146131
traceroute \
147132
triggerhappy \
148133
usb-modeswitch \
@@ -154,24 +139,39 @@ RUN apt-get update \
154139
wpasupplicant \
155140
xauth \
156141
xdg-user-dirs \
157-
xml-core \
158142
xxd \
159143
zlib1g-dev:armhf \
160-
autotools-dev \
161-
autoconf \
162-
automake \
163-
cmake \
164-
bison \
165-
flex \
166-
libtool \
167-
python-dev \
168-
python-pip \
169-
&& git clone --depth 1 https://github.com/raspberrypi/firmware /tmp/firmware \
170-
&& mv /tmp/firmware/hardfp/opt/vc /opt \
171-
&& echo "/opt/vc/lib" >/etc/ld.so.conf.d/00-vmcs.conf \
172-
&& /sbin/ldconfig \
173-
&& rm -rf /tmp/* \
174-
&& rm -rf /var/lib/apt/lists/*
144+
ethtool \
145+
geoip-database \
146+
libalgorithm-diff-perl \
147+
parted \
148+
pi-bluetooth \
149+
psmisc \
150+
freetype2-doc \
151+
publicsuffix \
152+
python-rpi.gpio \
153+
python3-pkg-resources \
154+
python3-requests \
155+
python3-six \
156+
python3-urllib3 \
157+
rng-tools \
158+
rsync \
159+
rsyslog \
160+
ssh-import-id \
161+
gdbm-l10n \
162+
javascript-common \
163+
multiarch-support \
164+
tasksel \
165+
libraspberrypi-bin \
166+
libraspberrypi-dev \
167+
libraspberrypi-doc \
168+
libsigc++-1.2-dev \
169+
raspberrypi-kernel \
170+
raspi-copies-and-fills \
171+
&& apt-get remove git \
172+
&& apt-get autoremove \
173+
&& rm -rf /tmp/* \
174+
&& rm -rf /var/lib/apt/lists/*
175175

176176
#set the entrypoint
177177
ENTRYPOINT ["/etc/init.d/entrypoint.sh"]
@@ -182,5 +182,5 @@ EXPOSE 22
182182
#set STOPSGINAL
183183
STOPSIGNAL SIGTERM
184184

185-
#stop processing ARM emulation (comment out next line if built on Raspberry)
185+
#disable cross compiling (comment out next line if built on Raspberry Pi)
186186
RUN [ "cross-build-end" ]

README.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,41 @@
77

88
Made for [netPI](https://www.netiot.com/netpi/), the Raspberry Pi 3B Architecture based industrial suited Open Edge Connectivity Ecosystem
99

10-
### Raspbian with SSH and user pi
10+
### Secured netPI Docker
11+
12+
netPI features a restricted Docker protecting the system software's integrity by maximum. The restrictions are
13+
14+
* privileged mode is not automatically adding all host devices `/dev/` to a container
15+
* volume bind mounts to rootfs is not supported
16+
* the devices `/dev`,`/dev/mem`,`/dev/sd*`,`/dev/dm*`,`/dev/mapper`,`/dev/mmcblk*` cannot be added to a container
17+
18+
### Container features
19+
20+
The image provided hereunder deploys a container with Debian, SSH server, Raspberry Pi userland tool and created user pi.
1121

1222
Base of this image builds [debian](https://www.balena.io/docs/reference/base-images/base-images/) with enabled [SSH](https://en.wikipedia.org/wiki/Secure_Shell), created user 'pi' and preinstalled packages of a headless Raspbian lite.
1323

14-
#### Container prerequisites
24+
### Container setup
1525

16-
##### Port mapping
26+
#### Port mapping
1727

18-
For remote login to the container across SSH the container's SSH port `22` needs to be mapped to any free netPI Host port.
28+
For a SSH login to the container any unused netPI host port needs to be added to the container port `22` (SSH).
1929

20-
##### Hostname
30+
#### Hostname (optional)
2131

22-
A normal Raspberry Pi has the default hostname `raspberrypi`. For equal conditions set the container's hostname to the same string.
32+
For an equal standard Raspberry Pi condition set the container hostname to `raspberrypi`.
2333

24-
##### Privileged mode (optional)
34+
#### Privileged mode (optional)
2535

2636
The privileged mode option needs to be activated to lift the standard Docker enforced container limitations. With this setting the container and the applications inside are the getting (almost) all capabilities as if running on the Host directly.
2737

2838
netPI's secure reference software architecture prohibits root access to the Host system always. Even if priviledged mode is activated the intrinsic security of the Host Linux Kernel can not be compromised.
2939

30-
##### Host device (optional)
40+
#### Host device (optional)
3141

32-
The container includes the [userland](https://github.com/raspberrypi/userland) tools you find installed in standard Raspbian OS too. To grant access of tools like [vcmailbox](https://github.com/raspberrypi/userland/blob/master/host_applications/linux/apps/vcmailbox/vcmailbox.c) the `/dev/vcio` and `/dev/vchiq` and `/dev/vc-mem` host devices need to be exposed to the container. (Prerequisite is running the container in privileged mode).
42+
The container includes the [userland](https://github.com/raspberrypi/userland) tools installed with original Raspbian OS too. To grant access of tools like [vcmailbox](https://github.com/raspberrypi/userland/blob/master/host_applications/linux/apps/vcmailbox/vcmailbox.c) the `/dev/vcio` and `/dev/vchiq` and `/dev/vc-mem` host devices need to be exposed to the container. (Prerequisite is running the container in privileged mode).
3343

34-
#### Getting started
44+
### Container deployment
3545

3646
STEP 1. Open netPI's website in your browser (https).
3747

@@ -42,7 +52,7 @@ STEP 3. Enter the following parameters under *Containers > + Add Container*
4252
Parameter | Value | Remark
4353
:---------|:------ |:------
4454
*Image* | **hilschernetpi/netpi-raspbian**
45-
*Network > Hostname* | **raspberrypi**
55+
*Network > Hostname* | **raspberrypi** | optional
4656
*Port mapping* | *host* **22** -> *container* **22** | *host*=any unused
4757
*Restart policy* | **always**
4858
*Runtime > Devices > +add device* | *Host path* **/dev/vcio** -> *Container path* **/dev/vcio** | optional
@@ -54,25 +64,29 @@ STEP 4. Press the button *Actions > Start/Deploy container*
5464

5565
Pulling the image may take a while (5-10mins). Sometimes it may take too long and a time out is indicated. In this case repeat STEP 4.
5666

57-
#### Accessing
67+
### Container access
5868

59-
The container starts the SSH server automatically. Open a terminal connection to it with an SSH client such as [putty](http://www.putty.org/) using netPI's IP address at your mapped port.
69+
The container automatically starts the SSH server. For a SSH session use a SSH client such as [putty](http://www.putty.org/) with the netPI IP address (@mapped SSH host port number).
6070

61-
As with a Raspberry Pi use the default credentials `pi` as user and `raspberry` as password when asked and you are logged in as non-root user `pi`.
71+
Use the credentials `pi` as user and `raspberry` as password when asked and you are logged in as non-root user `pi`.
6272

6373
Continue to use [Linux commands](https://www.raspberrypi.org/documentation/linux/usage/commands.md) in the terminal as usual.
6474

65-
#### Youtube
75+
### Container on Youtube
6676

6777
[![Tutorial](https://img.youtube.com/vi/A-asfhl7b0c/0.jpg)](https://youtu.be/A-asfhl7b0c)
6878

69-
#### Automated build
79+
### Container tips & tricks
80+
81+
For additional help or information visit the Hilscher Forum at https://forum.hilscher.com/
82+
83+
### Contaner automated build
7084

7185
The project complies with the scripting based [Dockerfile](https://docs.docker.com/engine/reference/builder/) method to build the image output file. Using this method is a precondition for an [automated](https://docs.docker.com/docker-hub/builds/) web based build process on DockerHub platform.
7286

73-
DockerHub web platform is x86 CPU based, but an ARM CPU coded output file is needed for Raspberry systems. This is why the Dockerfile includes the [balena.io](https://balena.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/) steps.
87+
DockerHub web platform is x86 CPU based, but an ARM CPU coded output file is needed for Raspberry Pi systems. This is why the Dockerfile includes the [balena.io](https://balena.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/) steps.
7488

75-
#### License
89+
### License
7690

7791
View the license information for the software in the project. As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
7892
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

init.d/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ trap 'kill ${!}; term_handler' SIGINT SIGKILL SIGTERM SIGQUIT SIGTSTP SIGSTOP SI
1616
echo "starting ssh ..."
1717
sudo /etc/init.d/ssh start
1818

19+
# start dbus deamon
20+
echo "starting dbus ..."
21+
/etc/init.d/dbus start
22+
1923
# wait forever not to exit the container
2024
while true
2125
do

0 commit comments

Comments
 (0)