read-only file system, rmdir '/dist'
-
Hi, I need information on how to get around this problem. I created a docker file that I deployed on the Cloudron server but I get this error message towards the end:
Aug 04 16:58:17
Aug 04 16:58:18
Aug 04 16:58:24 2024-08-04T14:58:24.000Z
Aug 04 16:58:24 2024-08-04T14:58:24.000Z
Aug 04 16:58:24 > exemple@0.0.1 start:dev
Aug 04 16:58:24 > nest start --watch
Aug 04 16:58:27 => Healtheck error: Error: Timeout of 7000ms exceeded
Aug 04 16:58:28 2024-08-04T14:58:28.000Z
Aug 04 16:58:28 Error EROFS: read-only file system, rmdir '/dist'
Aug 04 16:58:28
Aug 04 16:58:28 \To give you a little more detail, this is a nestjs project, so when the image is built, the typescript is compiled and put in another folder to run, and I also have files that are written and read inside (it's a pdf generation from a url).
-
https://docs.cloudron.io/packaging/cheat-sheet/#read-only
You may need to make
/dist
a symlink to/app/data
or/run
-
Thank you, I'll take a look at it and get back to you as soon as possible. Thank you
-
EROFS: read-only file system, rmdir '/dist'
Aug 04 21:50:38
Aug 04 21:50:38
Aug 04 21:50:39 2024-08-04T19:50:39.000Z
Aug 04 21:50:39 2024-08-04T19:50:39.000Z
Aug 04 21:50:39 > apibetterhost@0.0.1 start:dev
Aug 04 21:50:39 > nest start --watch
Aug 04 21:50:39 Done.
Aug 04 21:50:39 Fresh installation, setting up data directory...
Aug 04 21:50:39 chown: cannot access '/app/data': No such file or directory
Aug 04 21:50:39 touch: cannot touch '/app/data/.initialized': No such file or directory
Aug 04 21:50:40 => Healtheck error: Error: connect ECONNREFUSED (myipadresse):3000Dockerfile:
FROM node:20 RUN apt-get update && apt-get install -y \ libnss3 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libcups2 \ libxcomposite1 \ libxdamage1 \ libxrandr2 \ libgbm1 \ libasound2 \ libpangocairo-1.0-0 \ libpangoft2-1.0-0 \ libpango1.0-0 \ libx11-xcb1 \ libx11-6 \ libxext6 \ libxfixes3 \ libxrender1 \ libxshmfence1 \ ca-certificates \ fonts-liberation \ libappindicator3-1 \ libnspr4 \ libxss1 \ lsb-release \ xdg-utils \ wget \ ghostscript \ && rm -rf /var/lib/apt/lists/* RUN npx playwright install WORKDIR / COPY package*.json ./ RUN npm install RUN npm install gsx-pdf-optimize --global COPY . . RUN npm run build RUN mkdir -p /run/app RUN mkdir -p /run/dist && ln -s /run/dist /dist COPY start.sh /app/start.sh RUN chmod +x /app/start.sh ENTRYPOINT ["/app/start.sh"] CMD ["npm", "run", "start:dev"]
#!/bin/bash mkdir -p /run/app mkdir -p /run/php/sessions if [[ ! -f /app/data/.initialized ]]; then echo "Fresh installation, setting up data directory..." touch /app/data/.initialized echo "Done." fi chown -R node:node /app/data chown www-data:www-data /run/php/sessions exec "$@"
Sorry, my comments are in French but it still doesn't work. I think I have misconfigured my docker.
-
This post is deleted!
-
This is not really readable, please but your code in code brackets.
ps: edit your post to avoid posting duplicates
What are code brackets, and how do I use them?
```
CODE GOES HERE
``` -
I've improved my message so it's more visible. in fact I have the impression that my folder link isn't working. because I still get this message: EROFS: read-only file system, rmdir '/dist'.
In a Nestjs project, the typescript compiler code will go into this dist file and inside it there will be read, write and delete operations. This is inside my docker container. So my question is how to either fix this docker to transfer it to another folder that has these permissions or how to change the permissions. In fact I have the impression that the construction of the image works well but to start the docker and start to make operations in this folder it does not work because there are restrictions as it is written in the doc. -
I am not familiar with how nestjs works during startup, but something tries to wholesale
rm
the/dist
folder. I guess it tries to rebuild the app on startup? You may have to copy the app from read-only to/run
first thing in start.sh and then start the app and not symlink the folder? Just a guess though. -