How can I install additional osftware packages in a container? #13016
-
Ask a Question!I am still struggling with the problem, that my container needs a couple of additional software packages (paperless-NGX) My container is basically a modified paperless-NGX system. This sript needs several packages, such as I think, I have to create my own image based on the current paperlessNGX-image and install the desired software there
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Yes, that approach is correct. To do this with Portainer, you need to build your custom image outside of Portainer first, then reference that image in your stack. Portainer does not currently support build: directives in Compose, so the workflow is:
FROM ghcr.io/paperless-ngx/paperless-ngx:latest
RUN pip install --no-cache-dir oracledb pypaperless #This is just an example(You may also pin a specific Paperless-NGX version instead of latest.)
In the same directory as the Dockerfile, run: docker build -t myuser/paperless-custom:latest .
For example, if using Docker Hub: docker login
docker push myuser/paperless-custom:latest(You can also use GHCR or a private registry if preferred.)
In your compose file, replace the original image with your custom one: services:
paperless:
image: myuser/paperless-custom:latest
# remaining configuration stays the samePortainer will then pull and run the already-built image.
When Paperless-NGX updates, you simply: This ensures you get the latest Paperless-NGX changes while keeping your custom packages included. |
Beta Was this translation helpful? Give feedback.
Yes, that approach is correct. To do this with Portainer, you need to build your custom image outside of Portainer first, then reference that image in your stack. Portainer does not currently support build: directives in Compose, so the workflow is:
(You may also pin a specific Paperless-NGX version instead of latest.)
In the same directory as the Dockerfile, run:
docker build -t myuser/paperless-custom:latest .For example, if using Docker Hub: