alseambusher / crontab-ui

Easy and safe way to manage your crontab file
https://lifepluslinux.blogspot.com/2015/06/crontab-ui-easy-and-safe-way-to-manage.html
MIT License
2.88k stars 478 forks source link

[Docker] Unable to run docker image on armv7l #230

Closed philskat closed 6 months ago

philskat commented 1 year ago

I was unable to run the docker image on my bananapim2zero or any other arm device.

Expected behavior

After running the container with the following command

docker run -d -p 8000:8000 alseambusher/crontab-ui

The application should run and be available on port 8000

Actual behavior

Running the command gives the warning:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested

After starting the container, the log shows the following error, which is a result of unsupported executables and the container stops:

exec /usr/bin/supervisord: exec format error

Possible solution

To solve this, the image should have multiple platform releases. The base image alpine already supports a few platforms. image

See Documentation on buildx I followed this tutorial by docker multi-arch build and images

To also create a multi-platform image, I have run the following command on Windows (docker buildx needs to be installed):

docker buildx build --platform linux/arm64,linux/amd64,linux/arm/v6,linux/arm/v7,linux/386 -t thedarkmen3000/crontab-ui:latest . --push

This will build images for amd64, i386 (32-bit) and arm (32-bit and 64-bit). See the published image here dockerhub thedarkmen3000/crontab-ui

Running the starting command with this image results in a running instance

docker run -d -p 8000:8000 thedarkmen3000/crontab-ui

Logs:

2023-02-10 11:41:04,047 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2023-02-10 11:41:04,085 INFO supervisord started with pid 1
2023-02-10 11:41:05,110 INFO spawned: 'crontab' with pid 8
2023-02-10 11:41:05,136 INFO spawned: 'crontabui' with pid 9
2023-02-10 11:41:06,145 INFO success: crontab entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-02-10 11:41:06,147 INFO success: crontabui entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.