Skip to content

Commit 85fb5d4

Browse files
authored
fix: raspbian pi4 dockerd failing with segmentation fault, issue #286 (#287)
fix: raspbian pi4 docked failing with segmentation fault
1 parent b854acf commit 85fb5d4

File tree

4 files changed

+69
-1
lines changed

4 files changed

+69
-1
lines changed

Diff for: .yamllint

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ignore: |
2020
test/**/states/**/*.sls
2121
.kitchen/
2222
kitchen.vagrant.yml
23+
docker/osarchmap.yaml
2324
docker/osfamilymap.yaml
2425
docker/osmap.yaml
2526

Diff for: docker/osarchmap.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ armhf:
4141
arch: armhf
4242
pkg:
4343
docker:
44+
{%- if grains.os == 'Raspbian' %}
45+
use_upstream: repo
46+
{%- else %}
4447
use_upstream: archive
48+
{%- endif %}
4549
archive:
4650
source_hash: '5e757cf65d99b0326f49cabbfc3b9a65151cb569f04fcb64a7a0c7424772c7cf'
4751
suffix: tgz

Diff for: docker/osmap.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ OEL:
4141
file: '/etc/yum.repos.d/docker-ce.repo'
4242
gpgkey: 'https://download.docker.com/linux/centos/gpg'
4343

44+
Raspbian:
45+
pkg:
46+
docker:
47+
repo:
48+
{%- if 'oscodename' in grains %}
49+
name: deb [arch=armhf] https://download.docker.com/linux/{{ grains.os|lower }} {{ grains.oscodename }} stable
50+
{%- endif %}
51+
file: /etc/apt/sources.list.d/docker.list
52+
gpgkey: "https://download.docker.com/linux/{{ grains.os|lower }}/gpg"
53+
54+
55+
compose:
56+
name: docker-compose
57+
use_upstream: package
4458
Amazon:
4559
pkg:
4660
docker:

Diff for: docs/README.rst

+50-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The other states support container managmement.
2828
:scale: 100%
2929
:target: https://github.com/semantic-release/semantic-release
3030

31-
A SaltStack formula for Docker on MacOS, GNU/Linux and Windows.
31+
A SaltStack formula for Docker on MacOS, GNU/Linux, Windows and Raspberry Pi (4b).
3232

3333
.. contents:: **Table of Contents**
3434
:depth: 1
@@ -59,6 +59,7 @@ Available Meta states
5959
*Meta-state (This is a state that includes other states)*.
6060

6161
This state installs the Docker solution (see https://docs.docker.io)
62+
for Raspberry Pi support please see `Notes <https://github.com/saltstack-formulas/docker-formula/blob/master/docs/README.rst#notes-on-raspberry-pi-support>`_
6263

6364
``docker.clean``
6465
^^^^^^^^^^^^^^^^
@@ -247,6 +248,54 @@ Sub-states
247248
Sub-states are available inside sub-directories.
248249

249250

251+
Notes on Raspberry Pi support
252+
-----------------------------
253+
254+
There are some caveats with regard to the support of this module on Rasberry Pi 4b's.
255+
256+
* This module has only been tested with Raspberry Pi 4b using Rasbian Os Version Buster
257+
258+
* This module supports raspbian only when used from Salt 3002.6. Salt 3003.x fails with template isses.
259+
260+
* Docker service is known to fail starting when freshly installed via this module on Rasbian Buster with all apt-get updates and upgrades performed. The error found in logs for failing to start is :code:`dockerd: failed to create NAT chain DOCKER`
261+
262+
The Reason for this is as documented `here <https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269>`_ . The following Fix followed by a restart fixes this.
263+
The summary reason is that the docker installer uses iptables for nat. Unfortunately Debian uses nftables. You can convert the entries over to nftables or just setup Debian to use the legacy iptables.
264+
On the target Raspberry Pi issue the following to resolve or incorporate the SLS before in your custom SLS
265+
266+
.. code-block:: bash
267+
268+
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
269+
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
270+
sudo shutdown -r 0 # Do a restart, Docker.d should then function
271+
272+
or the following SLS
273+
274+
.. code-block:: yaml
275+
276+
iptables:
277+
alternatives.set:
278+
- path: /usr/sbin/iptables-legacy
279+
ip6tables:
280+
alternatives.set:
281+
- path: /usr/sbin/ip6tables-legacy
282+
283+
The provisioning of docker to raspbian uses functionality from https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script. It specifically mentions
284+
Using these scripts is not recommended for production environments, and you should understand the potential risks before you use them:
285+
The reasons are stated as :
286+
287+
* The scripts require root or sudo privileges to run. Therefore, you should carefully examine and audit the scripts before running them.
288+
289+
* The scripts attempt to detect your Linux distribution and version and configure your package management system for you. In addition, the scripts do not allow you to customize any installation parameters. This may lead to an unsupported configuration, either from Docker’s point of view or from your own organization’s guidelines and standards.
290+
291+
* The scripts install all dependencies and recommendations of the package manager without asking for confirmation. This may install a large number of packages, depending on the current configuration of your host machine.
292+
293+
* The script does not provide options to specify which version of Docker to install, and installs the latest version that is released in the “edge” channel.
294+
295+
* Do not use the convenience script if Docker has already been installed on the host machine using another mechanism.
296+
297+
298+
250299
Testing
251300
-------
252301

0 commit comments

Comments
 (0)