Failure to build and run GGC in Docker on Ubuntu Core

0

I have Ubuntu Core 18 (GNU/Linux 5.3.0-1033-raspi2 armv7l) installed on a Raspberry Pi 4 Model B. As the aws-iot-greengrass snap has limited functionality, I decided to explore the possibility of installing GGC in a Docker container. I installed the Docker snap (v19.03.11), and attempted to install the amazon/ws-iot-greengrass docker image from docker hub ( https://hub.docker.com/r/amazon/aws-iot-greengrass ). After putting the GGC certs on the system, my first attempt at running the image failed with the following error:
FATAL tini (6) exec /greengrass-entrypoint.sh failed: Exec format error

As I appeared to have the same issue described in ( https://forums.aws.amazon.com/thread.jspa?threadID=309740 ), I removed the previous GG image and built my own Docker image using the Dockerfile download from https://docs.aws.amazon.com/greengrass/latest/developerguide/what-is-gg.html#gg-docker-download

I followed the instructions in the README, using the 'Dockerfile.alpine-armv7l' dockerfile. The build appeared to be successful, as the Dockerfile appeared to execute without issues, aside from two warnings:
WARNING: Ignoring APKINDEX.00740ba1.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.d8b2a6f4.tar.gz: No such file or directory
The image can be revealed with docker image ls as arm7l/aws-greengrass:1.10.2.

However, when I try to run the image I receive the error:
FATAL tini (6) exec /greengrass-entrypoint.sh failed: Permission denied

I would appreciate any help in figuring out why this error occurs and whether my use scenario is even possible. I understand it's not conventional.

Edited by: ole-OG on Sep 14, 2020 9:06 PM

ole-OG
gefragt vor 4 Jahren292 Aufrufe
4 Antworten
0

The output of sudo mount is:
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=1883688k,nr_inodes=158485,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=391432k,mode=755)
/dev/mmcblk0p2 on /writable type ext4 (rw,relatime)
/writable/system-data/var/lib/snapd/seed/snaps/core18_1889.snap on / type squashfs (ro,relatime)
/writable/system-data/var/lib/snapd/snaps/pi-kernel_200.snap on /lib/modules type squashfs (ro,relatime)
/writable/system-data/var/lib/snapd/snaps/pi-kernel_200.snap on /lib/firmware type squashfs (ro,relatime)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,mode=755)
tmpfs on /etc/fstab type tmpfs (rw,nosuid,noexec,relatime,mode=755)
/dev/mmcblk0p2 on /etc/writable type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/apparmor.d/cache type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/dbus-1/session.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/dbus-1/system.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/hosts type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/iproute2 type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/modprobe.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/modules-load.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/netplan type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/network/if-up.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/ssh type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/sudoers.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/systemd type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/udev/rules.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/cloud type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/sysctl.d type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/default/swapfile type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/environment type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/systemd/system type ext4 (rw,relatime)
/dev/mmcblk0p2 on /etc/machine-id type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=32865)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mmcblk0p2 on /var/lib/dbus type ext4 (rw,relatime)
tmpfs on /media type tmpfs (rw,relatime)
/dev/mmcblk0p2 on /var/snap type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/lib/misc type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/log type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/lib/private/systemd type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/lib/snapd type ext4 (rw,relatime)
/dev/mmcblk0p2 on /home type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/lib/systemd type ext4 (rw,relatime)
/dev/mmcblk0p2 on /snap type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/lib/cloud type ext4 (rw,relatime)
tmpfs on /var/lib/sudo type tmpfs (rw,relatime,mode=700)
tmpfs on /mnt type tmpfs (rw,relatime)
/dev/mmcblk0p2 on /root type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/lib/extrausers type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/tmp type ext4 (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
/dev/mmcblk0p2 on /var/lib/console-conf type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/cache type ext4 (rw,relatime)
/dev/mmcblk0p2 on /var/lib/dhcp type ext4 (rw,relatime)
/writable/system-data/var/lib/snapd/seed/snaps/core18_1889.snap on /snap/core18/1889 type squashfs (ro,nodev,relatime,x-gdu.hide)
/writable/system-data/var/lib/snapd/seed/snaps/core18_1889.snap on /writable/system-data/snap/core18/1889 type squashfs (ro,nodev,relatime)
/var/lib/snapd/snaps/snapd_8792.snap on /snap/snapd/8792 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/snapd_8792.snap on /writable/system-data/snap/snapd/8792 type squashfs (ro,nodev,relatime)
/var/lib/snapd/snaps/pi_73.snap on /snap/pi/73 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/pi_73.snap on /writable/system-data/snap/pi/73 type squashfs (ro,nodev,relatime)
/writable/system-data/var/lib/snapd/snaps/pi-kernel_200.snap on /snap/pi-kernel/200 type squashfs (ro,nodev,relatime,x-gdu.hide)
/writable/system-data/var/lib/snapd/snaps/pi-kernel_200.snap on /writable/system-data/snap/pi-kernel/200 type squashfs (ro,nodev,relatime)
/var/lib/snapd/snaps/aws-iot-greengrass_6.snap on /snap/aws-iot-greengrass/6 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/aws-iot-greengrass_6.snap on /writable/system-data/snap/aws-iot-greengrass/6 type squashfs (ro,nodev,relatime)
/var/lib/snapd/snaps/core_9805.snap on /snap/core/9805 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_9805.snap on /writable/system-data/snap/core/9805 type squashfs (ro,nodev,relatime)
/var/lib/snapd/snaps/nano_29.snap on /snap/nano/29 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/nano_29.snap on /writable/system-data/snap/nano/29 type squashfs (ro,nodev,relatime)
/var/lib/snapd/seed/snaps/pi-kernel_186.snap on /snap/pi-kernel/186 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/seed/snaps/pi-kernel_186.snap on /writable/system-data/snap/pi-kernel/186 type squashfs (ro,nodev,relatime)
/var/lib/snapd/snaps/snapd_8792.snap on /usr/lib/snapd type squashfs (ro,nodev,relatime)
/dev/mmcblk0p1 on /boot/uboot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,noexec,relatime,size=391432k,mode=755)
nsfs on /run/snapd/ns/aws-iot-greengrass.mnt type nsfs (rw)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=391428k,mode=700,uid=1000,gid=1000)

The output of cat /etc/os-release is:
cat /etc/os-release
NAME="Ubuntu Core"
VERSION="18"
ID=ubuntu-core
PRETTY_NAME="Ubuntu Core 18"
VERSION_ID="18"
HOME_URL="https://snapcraft.io/"
BUG_REPORT_URL="http://bugs.launchpad.net/snappy/"

/greengrass doesn't exist

ole-OG
beantwortet vor 4 Jahren
0

Can you tell me the file permission of greengrass-entrypoint.sh in your system? Is the executable bit enabled?

beantwortet vor 4 Jahren
0

I understand that greengrass-entrypoint.sh is copied from the folder containing Dockerfiles during the image build process, but I am unable to locate location of greengrass-entrypoint.sh. It may differ from standard Linux systems due to the Ubuntu Core directory system, and the fact that Docker is installed as a snap. Any ideas?

ole-OG
beantwortet vor 4 Jahren
0

I removed the previously build image, changed the permissions of greengrass-entrypoint.sh in the directory containing Dockerfiles to grant rwx permission to all, then rebuilt the image. This appears to have worked, as confirmed by the successful deployment of a Greengrass group with stream manager enabled and a Python 3.7 Lambda function (HelloWorldTrigger from the greengrasssdk).

ole-OG
beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen