Docker post command


muwahhid

Recommended Posts

Hello. I use the official image of the Nextcloud container. But there are no ffmpeg packages or other packages, needed by me. So I install them manually, inside the container. But as you know, after updating the image, they are removed, and it is necessary to repeat everything. 
Is it possible to install packages, through The DockerMan settings, somehow automate? A postal argument, an extra argument for it? Please tell me.
I wrote in 'Post argument':        /bin/sh-c 'apt update - apt install -y ffmpeg'  .
Everything seems to work, but after a while the container starts to glitch on and off.
 

Link to comment
8 hours ago, muwahhid said:

Is it possible to install packages, through The DockerMan settings, somehow automate?

No this is not a feature of DockerMan or any other docker manager that i am aware of. Generally speaking containers are meant to be static things with everything you need already bundled in. Now on to how you can achieve what you are trying to do. 

 

If you happen to be using a LinuxServer.io container, you should look into their Docker Mods feature here. It is exactly the kind of thing you are looking to do, which is adding an extra variable to the container which will install extra packages. I dont know for sure if they have an ffmpeg DockerMod for Nextcloud but last i looked, it seemed pretty easy to create new mods.

 

Alternatively if you dont use an lsio container (or they dont have one) I would think the best option would be to look for a different nextcloud image with ffmpeg built in.

 

Finally if the above options dont pan out you can always roll your own image. Just write a simple Dockerfile that uses your image of choice as a base, and does a single run line to install your additional packages. With a free dockerhub account and github account you could setup your image to autobuild whenever the base image is updated.

Edited by primeval_god
  • Like 1
Link to comment
3 hours ago, primeval_god said:

Нет, это не функция DockerMan или любого другого диспетчера докеров, о котором я знаю. Вообще говоря, контейнеры должны быть статичными, со всем, что вам нужно, уже встроено. Теперь о том, как вы можете достичь того, что вы пытаетесь сделать. 

 

Если вы используете контейнер LinuxServer.io, вам следует изучить их функцию Docker Mods  здесь . Это именно то, что вы хотите сделать, - добавить дополнительную переменную в контейнер, которая установит дополнительные пакеты. Я не знаю наверняка, есть ли у них ffmpeg DockerMod для Nextcloud, но в последний раз, когда я смотрел, казалось довольно легко создавать новые моды.

 

В качестве альтернативы, если вы не используете контейнер lsio (или у них его нет), я бы подумал, что лучшим вариантом будет поиск другого образа nextcloud со встроенным ffmpeg.

 

Наконец, если вышеуказанные параметры не подходят, вы всегда можете создать собственное изображение. Просто напишите простой Dockerfile, который использует выбранный вами образ в качестве основы и выполняет одну строку запуска для установки ваших дополнительных пакетов. С бесплатной учетной записью dockerhub и учетной записью github вы можете настроить свой образ на автоматическую сборку при каждом обновлении базового образа.

Thank you for the answer. I use the original container, not the linuxserver. Through Dockerfile know how to make an image with my packages, but don't know how to set up an automatic image update in sync with the official image. I will study means in this direction.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.