I'm relatively new to Docker and I have an existing container that I'd like to keep using. I need to add hardware acceleration to this container using the following command:
docker run -d
--user 1000:1000
--group-add="992"
--device /dev/dri/renderD128:/dev/dri/renderD128
jellyfin/jellyfin
However, I want to know how I can apply these changes without creating a new container. Any suggestions?
6 Answers
Honestly, I highly recommend using Docker Compose to manage your containers—it makes everything easier!
You can't change the `--user` option of a running container. You might be able to adjust group settings by logging in and tweaking things, but I suggest just creating a new container. Why not?
You can't modify an already created container that's running. Containers are designed to be ephemeral, so you'll need to destroy the old one and create a new one with your desired settings. Just keep in mind that if you haven't set up persistent data correctly, you might lose some data during this process. Make sure to mount your data to the host to keep it safe!
A good approach is to back up your current configuration or custom files from the container (check if Jellyfin has an export feature). Then when you create a new container, use a persistent volume for storage and replace the exported files with the new setup. It's a bit of work but helps keep your configurations safe!
Thanks for the tip!
That's exactly the point of using containers! If you need persistent storage, you should set up a volume and reference it when you build the container.
Yep, containers are designed to be temporary. To keep your data, make sure you use volumes or bind mounts for external directories when setting things up, that way your data persists even if you create new containers.

You could copy your data from the container to your host before deleting it, but it's a hassle!