waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
448 stars 68 forks source link

Error when deploying with docker-compose #38

Closed GreenTeaBalls closed 1 year ago

GreenTeaBalls commented 1 year ago

Hi there,

I have been trying to deploy photo-stream using the Docker image that you provide.

I cloned the repository, and left docker-compose.yml and .env unchanged (I also tried with changing the values to my needs but still same result) and get the following error message with which the container exits:

root@dockerhost:/docker/photo-stream# docker-compose up 
Creating network "photo-stream_default" with the default driver
Creating photo-stream ... done
Attaching to photo-stream
photo-stream    | Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
photo-stream    | `/root` is not writable.
photo-stream    | Bundler will use `/tmp/bundler20220827-1-td0no01' as your home directory temporarily.
photo-stream    | bundler: command not found: jekyll
photo-stream    | Install missing gem executables with `bundle install`
photo-stream exited with code 127

Any idea what is going wrong? Thank you for your help!

GreenTeaBalls commented 1 year ago

I tried to dig a bit deeper into the issue. I tried all release tags on hub.docker.com down to 1.2.0 with the same results.

Then I spun up a container with a plain shell using this command docker run --rm -it --entrypoint /bin/sh waschinski/photo-stream:latest.

As the error I encountered complained about missing gems, I tried to execute this command from the Dockerfile in the container:

ruby -v && gem install bundler jekyll &&\
    bundle config --local build.sassc --disable-march-tune-native &&\
    bundle install

This resulted in the following error message:

/photo-stream # ruby -v && gem install bundler jekyll &&\
>     bundle config --local build.sassc --disable-march-tune-native &&\
>     bundle install
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-musl]
Fetching bundler-2.3.21.gem
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/bundle directory.

Permissions of root on /usr/local/bundle seem fine:

/photo-stream # ls -l /usr/local/
total 24
drwxr-xr-x    1 root     root          4096 Jul 14 23:02 bin
drwxrwxrwx    1 root     root          4096 Jul 14 23:05 bundle
drwxr-xr-x    2 root     root          4096 Apr  5 03:10 etc
drwxr-xr-x    1 root     root          4096 Jul 14 23:02 include
drwxr-xr-x    1 root     root          4096 Jul 14 23:02 lib
drwxr-xr-x    1 root     root          4096 Jul 14 23:02 share

I poked around the net a bit and found posts that indicate it may be a problem with the underlying Alpine OS?

GreenTeaBalls commented 1 year ago

After finding this post and following it to the Alpine release notes for 3.14, I figured it out by chance.

There seems to be a version requirement for docker that ruby on the Alpine OS image works.

After updating my docker installation from 19.x to 20.10.17 it works as expected.

oliverhihn commented 1 year ago

Please provide more information about the Host-OS and the Docker Version and docker-compose version. As far as I remember it worked perfectly fine out of the box on my raspberry pi, will check later if that's the case with the latest version.

GreenTeaBalls commented 1 year ago

Host OS is Debian Buster and here's version info on Docker / docker-compose:

root@dockerhost:~# docker version
Client: Docker Engine - Community
 Version:           20.10.17
 API version:       1.40
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:03:11 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:01:25 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.8
  GitCommit:        9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

root@dockerhost:~# docker-compose --version
docker-compose version 1.21.0, build unknown
waschinski commented 1 year ago

After updating my docker installation from 19.x to 20.10.17 it works as expected.

So it is working now?