andig / carddav2fb

Download CardDAV VCards and upload as phonebook to AVM FRITZ!Box
63 stars 19 forks source link

docker run => standard_init_linux.go:211: exec user process caused "exec format error" #202

Closed uelpenich closed 4 years ago

uelpenich commented 4 years ago

Raspberry Pi 3 with Buster

2nd try: pi@raspberrypi:/home/carddav2fb $ docker run --rm -v carddav2fb-config:/data andig/carddav2fb -i standard_init_linux.go:211: exec user process caused "exec format error"

andig commented 4 years ago

If you intended to pass a host directory, use absolute path.

This is obvious. Use an absolute path.

standard_init_linux.go:211: exec user process caused "exec format error"

This is obvious too. You cannot run an x64 image on a Raspi. We don't offer multi-arch builds yet but you can build your own.

uelpenich commented 4 years ago

As a Docker newbe I had appreciated a comment or hint that the docker image is an intel 64 bit image only. I wasted a lot of time to point it out.

Use an absolute path. Sorry, I followed the example: docker run --rm -v ./carddav2fb-config:/data andig/carddav2fb command...

Meanwhile I tried to build my own armv7 image. => The problem is for alpine linux no php-mailer package is available.

andig commented 4 years ago

Please open separate isseu for phpmailer- it should not be required.

andig commented 4 years ago

I would also appreciate a PR for fixing the example, sorry for giving the wrong guideline there.

uelpenich commented 4 years ago

Thank you for the fast image update. The docker version of Branch docker2 is working on a raspberry pi 3 running buster O/S. Build your own docker image with:

cd carddav2fb
docker build –t carddav2fb ./

Prepare the config directory carddav2fb-config used as docker volume and copy the prepared config.php to it:

mkdir carddav2fb-config
cp config.php carddav2fb-config

Run your own docker image: docker run --rm -v $(pwd)/carddav2fb-config:/data carddav2fb _command_ Question: Does the intended cron configuration work on raspberry buster? Copied config.example.cron to /data volume. Please edit and rename to config.cron If not then edit /etc/crontab to run carddav2fb once every day at 07:03

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
07   3  *  *  * root      docker run --rm -v /pi/carddav2fb/carddav2fb-config:/data carddav2fb run -i

Edit 13.05.2020 Meanwhile I checked the "cron functionality". I pointed out that the so called "cron functionality" has nothing common with linux cron. In reality it is an infinite run - sleep loop. It doesn't work due to 2 reasons:

  1. The doc says "Without a command, the container entrypoint will enter an endless loop, . . .", but you can't do a docker run without a command. To overcome the empty command parameter I created a command "loop" by modifying the file "docker-entrypoint": I changed the line if [ "$1" == "" ] ; then to if [ "$1" == "loop" ] ; then

  2. The "Dockerfile" misses the creation of a link to the file "config.cron". I modified the RUN command to RUN mkdir -p /data && \ cd /srv && \ composer install --no-dev && \ chmod +x /srv/carddav2fb /srv/docker-entrypoint && \ ln -s /data/config.php . && \ ln -s /data/config.cron As result the container is running an infinite loop of a "run carddav2fb" and a "sleep command" and blocks in my raspberry pi 1.5 MByte of memory. Therefor I prefer the cron method described above.

Last question: I am also a github newbe. Do you expect any action from me for merging the enhancements to the default branch?

Thank you for your work and the very useful carddav->fritzbox procedure.