psychowood/ghostfolio-docker

Stuck at step 3 docker-compose run

Closed this issue · 6 comments

Hello, I'm running this on a Raspberry Pi 3.

All the instruction worked until step 3

when I run the command
[...]ghostfolio-docker $ docker-compose run --rm base /scripts/install.sh

I get the following output:

Creating ghostfolio_base_run ... done
mkdir: can't create directory 'tmp': Permission denied
/scripts/install.sh: cd: line 5: can't cd to tmp: No such file or directory
Connecting to api.github.com (140.82.113.6:443)
Connecting to codeload.github.com (140.82.114.9:443)
writing to stdout
tar: can't open '.editorconfig': Permission denied
xargs: 'wget' terminated by signal 13
mv: can't rename '.env': Permission denied
tar: can't open './.env': Permission denied
rm: can't remove 'tmp/v8-compile-cache-0/8.4.371.23-node.84/zSoptzSyarn-v1.22.15zSbinzSyarn.js.MAP': Permission denied
rm: can't remove 'tmp/v8-compile-cache-0/8.4.371.23-node.84/zSoptzSyarn-v1.22.15zSbinzSyarn.js.BLOB': Permission denied
mv: can't rename 'apps/client/proxy.conf.json': No such file or directory
/scripts/install.sh: line 13: can't create apps/client/proxy.conf.json: nonexistent directory
mv: can't rename 'package.json': No such file or directory
/scripts/install.sh: line 16: can't create package.json: Permission denied
cat: can't open 'package.json.bak': No such file or directory
yarn install v1.22.15
warning Skipping preferred cache folder "/ghostfolio/tmp/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1100".
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error Could not write file "/yarn-error.log": "EACCES: permission denied, open '/yarn-error.log'"
error An unexpected error occurred: "EACCES: permission denied, mkdir '/node_modules'".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: ENOENT: no such file or directory, open '/ghostfolio/tmp/.yarnrc'
ERROR: 1

Looks like there a permission issue, but I can't figure it out, I'm not that familiar with the Docker.

Hi, can you share the output of step #2 docker build -t ghostfolio-base .?

It is surely a permission issue, I'm not sure why you get it tho. Which user is running the docker-compose command?

I'm running it as my non privileged user
I've tried running it with sudo, it didn't help.

When it says

mkdir: can't create directory 'tmp': Permission denied
/scripts/install.sh: cd: line 5: can't cd to tmp: No such file or directory

is this message from the container or from the host machines mounts?
i.e : where do i lack permissions??

Here is the output of the docker build

Sending build context to Docker daemon  295.9kB
Step 1/19 : FROM node:14-alpine3.14
14-alpine3.14: Pulling from library/node
a14774a5a62e: Pull complete
2d39c4d1086c: Pull complete
d90eed824f13: Pull complete
e7257e4c41d7: Pull complete
Digest: sha256:366c71eebb0da62a832729de2ffc974987b5b00ab25ed6a5bd8d707219b65de4
Status: Downloaded newer image for node:14-alpine3.14
 ---> 8b37e4e2a740
Step 2/19 : RUN apk --no-cache add curl xdg-utils
 ---> Running in 1e6dd9d68940
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/armv7/APKINDEX.tar.gz
(1/20) Installing ca-certificates (20191127-r5)
(2/20) Installing brotli-libs (1.0.9-r5)
(3/20) Installing nghttp2-libs (1.43.0-r0)
(4/20) Installing libcurl (7.79.1-r0)
(5/20) Installing curl (7.79.1-r0)
(6/20) Installing libxau (1.0.9-r0)
(7/20) Installing libmd (1.0.3-r0)
(8/20) Installing libbsd (0.11.3-r0)
(9/20) Installing libxdmcp (1.1.3-r0)
(10/20) Installing libxcb (1.14-r2)
(11/20) Installing libx11 (1.7.2-r0)
(12/20) Installing libxext (1.3.4-r0)
(13/20) Installing libice (1.0.10-r0)
(14/20) Installing libuuid (2.37-r0)
(15/20) Installing libsm (1.2.3-r0)
(16/20) Installing libxt (1.2.1-r0)
(17/20) Installing libxmu (1.1.3-r0)
(18/20) Installing xset (1.2.4-r0)
(19/20) Installing xprop (1.2.5-r0)
(20/20) Installing xdg-utils (1.1.3-r0)
Executing busybox-1.33.1-r3.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 12 MiB in 36 packages
Removing intermediate container 1e6dd9d68940
 ---> f0cc21f4a3c9
Step 3/19 : ENV USER=ghostfolio
 ---> Running in fbc06d7fc92f
Removing intermediate container fbc06d7fc92f
 ---> 10685094a2ad
Step 4/19 : ENV UID=1100
 ---> Running in 8fd5c0af63b8
Removing intermediate container 8fd5c0af63b8
 ---> aa22dda95f90
Step 5/19 : ENV GROUP=ghostfolio
 ---> Running in ec8948885083
Removing intermediate container ec8948885083
 ---> bdccae94c318
Step 6/19 : ENV GID=1100
 ---> Running in d820945f6ae6
Removing intermediate container d820945f6ae6
 ---> 841cadb25ca9
Step 7/19 : RUN addgroup -g "$GID" "$GROUP"
 ---> Running in 9ca5eeda6389
Removing intermediate container 9ca5eeda6389
 ---> 96dafec6d08d
Step 8/19 : WORKDIR /ghostfolio/tmp
 ---> Running in 42dff5d40187
Removing intermediate container 42dff5d40187
 ---> aca19a1b7a40
Step 9/19 : WORKDIR /.cache
 ---> Running in 455cd0758c9b
Removing intermediate container 455cd0758c9b
 ---> 92c5dd927008
Step 10/19 : RUN adduser     --disabled-password     --gecos ""     --home "/ghostfolio/tmp"     --ingroup "$GROUP"     --no-create-home     --uid "$UID"     "$USER"
 ---> Running in c032008b0635
Removing intermediate container c032008b0635
 ---> 742041b7bea9
Step 11/19 : RUN chown "$USER":"$GROUP" -vR /ghostfolio /.cache
 ---> Running in 975ee9ee7f89
changed ownership of '/ghostfolio/tmp' to 1100:1100
changed ownership of '/ghostfolio' to 1100:1100
changed ownership of '/.cache' to 1100:1100
Removing intermediate container 975ee9ee7f89
 ---> 11556ee7e1bb
Step 12/19 : USER "$USER"
 ---> Running in f39f4c83c15f
Removing intermediate container f39f4c83c15f
 ---> cb1775d3d3a5
Step 13/19 : WORKDIR /scripts
 ---> Running in a6e78f2b2242
Removing intermediate container a6e78f2b2242
 ---> b59f2a05d0fb
Step 14/19 : COPY --chown="$USER":"$GROUP" scripts/* ./
 ---> 774af8e040fe
Step 15/19 : RUN chmod +x *.sh
 ---> Running in 0a24423597dd
Removing intermediate container 0a24423597dd
 ---> 82b46759201b
Step 16/19 : WORKDIR /ghostfolio
 ---> Running in 3e7457182e7a
Removing intermediate container 3e7457182e7a
 ---> 267e0eec1501
Step 17/19 : ENTRYPOINT
 ---> Running in bc102df5f6a1
Removing intermediate container bc102df5f6a1
 ---> d4e18dd2716f
Step 18/19 : CMD ["echo", "Nothing to run here."]
 ---> Running in 6be95f890660
Removing intermediate container 6be95f890660
 ---> 5b042621737a
Step 19/19 : VOLUME ["/ghostfolio"]
 ---> Running in 90591e75d5fd
Removing intermediate container 90591e75d5fd
 ---> ba3d29396e14
Successfully built ba3d29396e14
Successfully tagged ghostfolio-base:latest

It is inside the container.

Everything should be run with uid:gid 1100 as set up in the base image.

Try adding " -u 1100 " after "run"

docker-compose run -u 1100 --rm base /scripts/install.sh

This command returns same results.

UPD: I tried to delete the existing volumes / networks (still same results)

cker-compose run -u 1100 --rm base /scripts/install.sh
Creating network "ghostfolio_default" with the default driver
Creating volume "ghostfolio_ghostfolio-data" with local driver
Creating volume "ghostfolio_postgres-data" with default driver
Creating volume "ghostfolio_redis-data" with default driver
Creating ghostfolio_base_run ... done
mkdir: can't create directory 'tmp': Permission denied
/scripts/install.sh: cd: line 5: can't cd to tmp: No such file or directory
Connecting to api.github.com (140.82.114.6:443)
Connecting to codeload.github.com (140.82.114.9:443)
writing to stdout
tar: can't open '.editorconfig': Permission denied
xargs: 'wget' terminated by signal 13
mv: can't rename '.env': Permission denied
tar: can't open './.env': Permission denied
rm: can't remove 'tmp/v8-compile-cache-0/8.4.371.23-node.84/zSoptzSyarn-v1.22.15zSbinzSyarn.js.MAP': Permission denied
rm: can't remove 'tmp/v8-compile-cache-0/8.4.371.23-node.84/zSoptzSyarn-v1.22.15zSbinzSyarn.js.BLOB': Permission denied
mv: can't rename 'apps/client/proxy.conf.json': No such file or directory
/scripts/install.sh: line 13: can't create apps/client/proxy.conf.json: nonexistent directory
mv: can't rename 'package.json': No such file or directory
/scripts/install.sh: line 16: can't create package.json: Permission denied
cat: can't open 'package.json.bak': No such file or directory
yarn install v1.22.15
warning Skipping preferred cache folder "/ghostfolio/tmp/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1100".
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error Could not write file "/yarn-error.log": "EACCES: permission denied, open '/yarn-error.log'"
error An unexpected error occurred: "EACCES: permission denied, mkdir '/node_modules'".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: ENOENT: no such file or directory, open '/ghostfolio/tmp/.yarnrc'
ERROR: 1

Ok, I think I replicated it. In my case the UID/GID of the external ghostfolio-data folder are the same (1100:1100) used inside the docker image user.

While I try to pull a fix, you can either:

  • change the ownership of the ghostfolio-data directory to 1100:1100 with chown -R 1100:1100 ghostfolio.data
  • change the last part of docker-compose.yml the following way, thus removing the usage of the ghostfolio-data directory (that can now be deleted):
volumes:
  ghostfolio-data:
  postgres-data:
  redis-data:

Fyi, I'm probably going with the latter in the repository files.

Pushed 1464c83 , tested working on Play with Docker.