jdel / sspks

A very simple Synology Package Server, reverse engineered from the official Synology package repository and SynoCommunity.
GNU General Public License v3.0
256 stars 63 forks source link

Docker image (latest) does not work #86

Closed MartinRothschink closed 2 years ago

MartinRothschink commented 2 years ago

Docker image says: Autoloader not found! Did you follow the instructions from the INSTALL.md? (If you want to keep the old version, switch to the legacy branch by running: git checkout legacy

I tracked the install and the issue is here:

/home/user # curl -sSL https://getcomposer.org/download/1.6.5/composer.phar -o /usr/local/bin/composer /home/user # chmod +x /usr/local/bin/composer /home/user # cd /var/www/localhost/htdocs /var/www/localhost/htdocs # composer install --no-dev

PHP Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in phar:///usr/local/bin/composer/vendor/symfony/polyfill-mbstring/Mbstring.php:661 Stack trace:

0 phar:///usr/local/bin/composer/vendor/symfony/polyfill-mbstring/bootstrap.php(48): Symfony\Polyfill\Mbstring\Mbstring::mb_strwidth(' [Composer\Exc...', 'ASCII')

1 phar:///usr/local/bin/composer/vendor/symfony/console/Helper/Helper.php(54): mb_strwidth(' [Composer\Exc...', 'ASCII')

2 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(654): Symfony\Component\Console\Helper\Helper::strlen(' [Composer\Exc...')

3 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(Composer\Exception\NoSslException), Object(Symfony\Component\Console\Output\StreamOutput))

4 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(100): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object( in phar:///usr/local/bin/composer/vendor/symfony/polyfill-mbstring/Mbstring.php on line 661

picrap commented 2 years ago

I am totally incomptetent for this. It look like a job for @jdel 😉

3x3cut0r commented 2 years ago

The Dockerfile should be updated to new alpine and composer versions! composer 2.2.6 instead of 1.6.5 should fix this issue. btw we can update alpine to 3.14 too.

EDIT: ok no ... updating the versions isn't enough. i build my own image 3x3cut0r/sspks:latest with 3.14 and 2.2.6. same issue again

EDIT2: using composer:2.2.6 as base image which is using php:8-alpine as base image can run the composer install without errors. you can try using my image: https://hub.docker.com/r/3x3cut0r/sspks/tags

but i got now php errors like before with my jdel image.

[Wed Feb 16 06:46:27.155696 2022] [php7:warn] [pid 12] [client 10.24.10.1:53606] PHP Warning: touch(): Unable to create file cache/PlexMediaServer-1.25.6.5545-c8bd13540-x86_64_DSM7.wiz because Permission denied in /var/www/localhost/htdocs/lib/SSpkS/Package/Package.php on line 262 [Wed Feb 16 06:46:27.157108 2022] [php7:warn] [pid 12] [client 10.24.10.1:53606] PHP Warning: rename(cache/PlexMediaServer-1.25.6.5545-c8bd13540-x86_64_DSM7_thumb_72.png): failed to open stream: Permission denied in /var/www/localhost/htdocs/lib/SSpkS/Package/Package.php on line 221 [Wed Feb 16 06:46:27.157167 2022] [php7:warn] [pid 12] [client 10.24.10.1:53606] PHP Warning: rename(/tmp/PACKAGE_ICON.PNG,cache/PlexMediaServer-1.25.6.5545-c8bd13540-x86_64_DSM7_thumb_72.png): Permission denied in /var/www/localhost/htdocs/lib/SSpkS/Package/Package.php on line 221 [Wed Feb 16 06:46:27.160152 2022] [php7:warn] [pid 12] [client 10.24.10.1:53606] PHP Warning: rename(cache/PlexMediaServer-1.25.6.5545-c8bd13540-x86_64_DSM7_thumb_120.png): failed to open stream: Permission denied in /var/www/localhost/htdocs/lib/SSpkS/Package/Package.php on line 221 [Wed Feb 16 06:46:27.160343 2022] [php7:warn] [pid 12] [client 10.24.10.1:53606] PHP Warning: rename(/tmp/PACKAGE_ICON_256.PNG,cache/PlexMediaServer-1.25.6.5545-c8bd13540-x86_64_DSM7_thumb_120.png): Permission denied in /var/www/localhost/htdocs/lib/SSpkS/Package/Package.php on line 221

but i think i should open another issue for this

picrap commented 2 years ago

Hi, could you provide a pull request?

3x3cut0r commented 2 years ago

its on https://github.com/3x3cut0r/docker/blob/main/sspks/Dockerfile or what do you meen?

3x3cut0r commented 2 years ago

related to my other problem #68 i use my image with env: COMPOSER_HOME="/cache" to fix the permission errors

picrap commented 2 years ago

The only significant change I see in your Dockerfile is the change in composer version, am I right? If yes, I can update the Dockerfile here.

3x3cut0r commented 2 years ago

yes and the base image which provides a newer alpine image and a correctly installed composer 2.2.6 environment with php-8. your image installes php7 ... maybe we could also update to 8?!

i will continue on this

picrap commented 2 years ago

I made the two changes in the Dockerfile, let me know if it works (PHP 8 is another story 😅)

3x3cut0r commented 2 years ago

did you update your docker image on dockerhub too? its still the old one ...

picrap commented 2 years ago

I am no Docker user at all, but the original author @jdel told me the deployment is automated.

jdel commented 2 years ago

looks like the CI responsible for building doesn't work anymore, i'll have to look into it

jdel commented 2 years ago

Turns out I needed to migrate the repo to the new travis CI. The docker build still has an error https://app.travis-ci.com/github/jdel/sspks/builds/246543710

picrap commented 2 years ago

The mkdir /run/apache was removed from @3x3cut0r Dockerfile, perhaps a mkdir -p … could do the trick.

picrap commented 2 years ago

It did 😎 https://app.travis-ci.com/github/jdel/sspks/builds/246544203

jdel commented 2 years ago

Looks like docker hub has put automated builds behing a paywall now. I'll have to look into replacing docker repository and possibly travis ci to github actions and github packages.

3x3cut0r commented 2 years ago

scheduled actions to dockerhub is not working anymore ... but you can still run git actions on push to docker hub. see my git action for sspks which push the Dockerfile to docker hub on every push: https://github.com/3x3cut0r/docker/blob/main/.github/workflows/sspks.yml

jdel commented 2 years ago

Yes I need to migrate to github actions at some point but I don't have much time right now. I did a few changes in the Dockerfile and pushed a new docker image jdel/sspks:updated-dockerfile if someone wants to try and let me know.

3x3cut0r commented 2 years ago

although I can't find now any differences between your dockerfile and mine ... jdel/sspks:updated-dockerfile still gets me "Autoloader not found!" error message while mine does not ...

jdel commented 2 years ago

My bad, I pushed the wrong one, can you give it another go ? It was missing some new php8 dependencies. Should be good now.

3x3cut0r commented 2 years ago

now its running!

jdel commented 2 years ago

Workflows are now fixed. latest corresponds to the latest release (now v1.2.0), while master is the edge package with unreleased changes.