Made for Raspberry Pi 3B architecture based devices and compatibles
https://hub.docker.com/r/hilschernetpi/netpi-raspbian/
The image provided hereunder deploys a Debian based container with SSH server, pre-compiled software/packages found installed on Raspbian OS (inclusive userland tools) and a default user which is pi
.
Base of this image builds debian with enabled SSH, installed userland tools, created user 'pi' and preinstalled packages of a Raspbian lite operating system (headless).
The container has been successfully tested on the following hosts
- netPI, model RTE 3, product name NIOT-E-NPI3-51-EN-RE
- netPI, model CORE 3, product name NIOT-E-NPI3-EN
- netFIELD Connect, product name NIOT-E-TPI51-EN-RE/NFLD
- Raspberry Pi, model 3B
- Raspberry Pi, model 4B (arm32v7,arm64v8)
netPI devices specifically feature a restricted Docker protecting the Docker host system software's integrity by maximum. The restrictions are
- privileged mode is not automatically adding all host devices
/dev/
to a container - volume bind mounts to rootfs is not supported
- the devices
/dev
,/dev/mem
,/dev/sd*
,/dev/dm*
,/dev/mapper
,/dev/mmcblk*
cannot be added to a container
The container binds the SSH server port to 22
by default.
For an alternative port use the variable SSHPORT with the desired port number as value.
The container supports the bridged or host network mode. More details at Container networking.
Any unused Docker host port needs to be mapped to the default container port 22
or the one set by SSHPORT to expose the container SSH server to the Docker host.
Remark: Container bluetooth functionality is supported in host network mode only.
Port mapping is unnecessary since all the used container ports (like 22
or SSHPORT) are exposed to the host automatically.
Remark: Host network mode is mandatory for using container bluetooth functions.
For an equal default Raspbian OS hostname set the container hostname to raspberrypi
.
The privileged mode lifts the standard Docker enforced container limitations: applications inside a container are getting (almost) all capabilities as if running on the host directly.
Enabling the privileged mode is optional but mandatory for the following container functions:
- bluetooth
- userland tools
For bluetooth functionality the /dev/ttyAMA0
Docker host device needs to be added to the container. In conjunction the /dev/vcio
Docker host device needs be added to the container as well to allow bluetooth controller resets.
For using userland tools like vcmailbox the /dev/vcio
and /dev/vchiq
and /dev/vc-mem
Docker host devices need to be added to the container.
Pulling the image may take 10 minutes.
STEP 1. Open netPI's web UI in your browser (https).
STEP 2. Click the Docker tile to open the Portainer.io Docker management user interface.
STEP 3. Enter the following parameters under Containers > + Add Container
Parameter | Value | Remark |
---|---|---|
Image | hilschernetpi/netpi-raspbian | a :tag may be added as well |
Network > Network | bridge or host | use either or |
Network > Hostname | raspberrypi | optional |
Restart policy | always | |
Adv.con.set. > Env > +add env.var. | name SSHPORT -> value any number value | optional for different SSH port |
Port mapping | host unused port -> container 22 / SSHPORT | in bridged mode only |
Adv.con.set. > Devices > +add device | Host path /dev/ttyAMA0 -> Container path /dev/ttyAMA0 | optional for bluetooth |
Adv.con.set. > Devices > +add device | Host path /dev/vcio -> Container path /dev/vcio | optional for bluetooth, userland tools |
Adv.con.set. > Devices > +add device | Host path /dev/vchiq -> Container path /dev/vchiq | optional for userland tools |
Adv.con.set. > Devices > +add device | Host path /dev/vc-mem -> Container path /dev/vc-mem | optional for userland tools |
Adv.con.set. > Privileged mode | On | optional for bluetooth, userland tools |
STEP 4. Press the button Actions > Start/Deploy container
docker run -d --privileged --network=host --restart=always -e SSHPORT=22 --device=/dev/ttyAMA0:/dev/ttyAMA0 --device=/dev/vcio:/dev/vcio --device=/dev/vchiq:/dev/vchiq --device=/dev/vc-mem:/dev/vc-mem -p 22:22/tcp hilschernetpi/netpi-raspbian
A docker-compose.yml
file could look like this
version: "2"
services:
nodered:
image: hilschernetpi/netpi-raspbian
restart: always
privileged: true
network_mode: host
ports:
- 22:22
devices:
- "/dev/ttyAMA0:/dev/ttyAMA0"
- "/dev/vcio:/dev/vcio"
- "/dev/vchiq:/dev/vchiq"
- "/dev/vc-mem:/dev/vc-mem"
environment:
- SSHPORT=22
The container starts the SSH server automatically when deployed.
For an SSH terminal session use an SSH client such as putty with the Docker host IP address (@port number 22
or SSHPORT or bridge mode mapped one).
Use the credentials pi
as user and raspberry
as password when asked and you are logged in as non-root user pi
.
Continue to use Linux commands in the terminal as usual.
Copyright (c) Hilscher Gesellschaft fuer Systemautomation mbH. All rights reserved. Licensed under the LISENSE.txt file information stored in the project's source code repository.
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). 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.
Hilscher Gesellschaft fuer Systemautomation mbH www.hilscher.com