Open ZigzagSecurity opened 1 month ago
Describe the bug Hi ! I've been trying to create a custom docker image including some plugins but i'm running into some issues concerning local plugins. The image builds successfully if i specify only plugins from NPM registry but as soon as i include a local plugin it fails to find the "package.json" file and exit the build with an error.
To Reproduce Steps to reproduce the behavior:
- Follow the instruction from github repo to create a custom docker image.
- Modify the Dockerfile as follow (just adding a local plugin):
ARG ETHERPAD_LOCAL_PLUGINS="../ep_markdown"
- Start the build process with:
sudo docker build . -t tmp/etherpad
- Then get the error with the local plugin
Expected behavior The build should complete successfully and the local plugin should be installed.
Screenshots The only modification of the Dockerfile:
The error during the build:
Server (please complete the following information):
- Etherpad version: 2.1.1
- OS:
- Node.js version (
node --version
): node:alpine from docker- npm version (
npm --version
): 9.0.4- Is the server free of plugins: yes
Additional context I've tried with plugins i've modified myself but also with plugins i've downloaded from npm and put in my local system but the result is the same.
Thanks for reading and your amazing work on Etherpad !
Hi I had a look at it. It's actually pretty hard to integrate a plugin into the Docker Image. We have the problem that we build now everything in the Dockerfile and Docker does not have access to the host system. @JannikStreek do you have time to take the matter into your hand? I'm not really familiar with the new Docker directives maybe you can there map a local volume
Describe the bug Hi ! I've been trying to create a custom docker image including some plugins but i'm running into some issues concerning local plugins. The image builds successfully if i specify only plugins from NPM registry but as soon as i include a local plugin it fails to find the "package.json" file and exit the build with an error. To Reproduce Steps to reproduce the behavior:
- Follow the instruction from github repo to create a custom docker image.
- Modify the Dockerfile as follow (just adding a local plugin):
ARG ETHERPAD_LOCAL_PLUGINS="../ep_markdown"
- Start the build process with:
sudo docker build . -t tmp/etherpad
- Then get the error with the local plugin
Expected behavior The build should complete successfully and the local plugin should be installed. Screenshots The only modification of the Dockerfile: The error during the build: Server (please complete the following information):
- Etherpad version: 2.1.1
- OS:
- Node.js version (
node --version
): node:alpine from docker- npm version (
npm --version
): 9.0.4- Is the server free of plugins: yes
Additional context I've tried with plugins i've modified myself but also with plugins i've downloaded from npm and put in my local system but the result is the same. Thanks for reading and your amazing work on Etherpad !
Hi I had a look at it. It's actually pretty hard to integrate a plugin into the Docker Image. We have the problem that we build now everything in the Dockerfile and Docker does not have access to the host system. @JannikStreek do you have time to take the matter into your hand? I'm not really familiar with the new Docker directives maybe you can there map a local volume
I can have a look at it. On first glance, the given plugins are indeed currently not copied into the container so it can't really work.
Describe the bug Hi ! I've been trying to create a custom docker image including some plugins but i'm running into some issues concerning local plugins. The image builds successfully if i specify only plugins from NPM registry but as soon as i include a local plugin it fails to find the "package.json" file and exit the build with an error. To Reproduce Steps to reproduce the behavior:
- Follow the instruction from github repo to create a custom docker image.
- Modify the Dockerfile as follow (just adding a local plugin):
ARG ETHERPAD_LOCAL_PLUGINS="../ep_markdown"
- Start the build process with:
sudo docker build . -t tmp/etherpad
- Then get the error with the local plugin
Expected behavior The build should complete successfully and the local plugin should be installed. Screenshots The only modification of the Dockerfile: The error during the build: Server (please complete the following information):
- Etherpad version: 2.1.1
- OS:
- Node.js version (
node --version
): node:alpine from docker- npm version (
npm --version
): 9.0.4- Is the server free of plugins: yes
Additional context I've tried with plugins i've modified myself but also with plugins i've downloaded from npm and put in my local system but the result is the same. Thanks for reading and your amazing work on Etherpad !
Hi I had a look at it. It's actually pretty hard to integrate a plugin into the Docker Image. We have the problem that we build now everything in the Dockerfile and Docker does not have access to the host system. @JannikStreek do you have time to take the matter into your hand? I'm not really familiar with the new Docker directives maybe you can there map a local volume
I can have a look at it. On first glance, the given plugins are indeed currently not copied into the container so it can't really work.
Thanks for the help :)
@ZigzagSecurity I think the easiest way (which doesn't need any changes in the code base ) would be to mount your local files (e.g. in the docker compose volume section). Lets take the example of "../ep_markdown":
volumes:
- ../ep_markdown:/opt/ep_markdown
You can also mount without using docker compose, but its easier to demonstrate it in this case.
With that it should work 🤔 Can you test it?
@ZigzagSecurity I think the easiest way (which doesn't need any changes in the code base ) would be to mount your local files (e.g. in the docker compose volume section). Lets take the example of "../ep_markdown":
volumes: - ../ep_markdown:/opt/ep_markdown
You can also mount without using docker compose, but its easier to demonstrate it in this case.
With that it should work 🤔 Can you test it?
Ah sorry, my bad, that won't work as the mount is too late. Can you add this to your docker file before the install command (RUN bin/installDeps.sh
) is reached in the Dockerfile and see if it works:
COPY --chown=etherpad:etherpad ../ep_markdown ../ep_markdown/
Otherwise I will test myself later. We should modify the docker file to copy all plugins given in ETHERPAD_LOCAL_PLUGINS
to the container during build time before the install command is called.
@JannikStreek i tried it but went into the same issue as reported in the first place. The instruction you specified did not work as the folder is out of the Docker context and thus can't be reach during the build (from what i could understand after a quick google search).
I changed it to:
COPY --chown=etherpad:etherpad ./ep_markdown ./ep_markdown/
The plugins seems to be copied to the docker but then an error happens when the dependencies are being installed.
i also changed the argument for local plugin accordingly:
ARG ETHERPAD_LOCAL_PLUGINS="./ep_markdown"
Describe the bug Hi ! I've been trying to create a custom docker image including some plugins but i'm running into some issues concerning local plugins. The image builds successfully if i specify only plugins from NPM registry but as soon as i include a local plugin it fails to find the "package.json" file and exit the build with an error.
To Reproduce Steps to reproduce the behavior:
ARG ETHERPAD_LOCAL_PLUGINS="../ep_markdown"
sudo docker build . -t tmp/etherpad
Expected behavior The build should complete successfully and the local plugin should be installed.
Screenshots The only modification of the Dockerfile:
The error during the build:
Server (please complete the following information):
node --version
): node:alpine from dockernpm --version
): 9.0.4Additional context I've tried with plugins i've modified myself but also with plugins i've downloaded from npm and put in my local system but the result is the same.
Thanks for reading and your amazing work on Etherpad !