How to install additional packages in Docker container?

  • I'm sure this is a basic task, but I'm brand new to docker and having trouble figuring out how to do this within the OMV framework.


    I'm running handbrake in a container and also need mkvtoolnix installed for some automation. This seems to be the best/simplest example that I've found for that:


    How to install packages from Docker compose?
    Hi there I am new to Docker. I have an docker-compose.yml which looks like this: version: "3" services: lmm-website: image:…
    stackoverflow.com


    It uses compose to setup the container and then Dockerfile to install the package I need. I'm able to run the container successfully, but the RUN command in Dockerfile doesn't seem to be getting executed. If I run the same as root in the running container, mkvtoolnix installs just fine.


    Here's the container I'm running, for reference:


    GitHub - jlesage/docker-handbrake: Docker container for HandBrake
    Docker container for HandBrake. Contribute to jlesage/docker-handbrake development by creating an account on GitHub.
    github.com


    My compose file:



    And my Dockerfile:


    Docker
    FROM jlesage/handbrake:v1.25.1
    
    RUN apk update && apk add --no-cache ${INSTALL_PACKAGES}


    I've tried specifying mkvtoolnix instead of through ${INSTALL_PACKAGES} and tried splitting that into multiple RUN statements, but nothing seems to have any effect. I don't get any error message when bringing the container up, and so far haven't been able to find any logs that give a hint on what's failing.


    Any suggestions? I feel like I must be missing something really simple.

    • Official Post

    To work with the Compose plugin, you should put the Dockerfile in the Dockerfile tab to build the image. Then just reference that image in your compose file removing the build section.

    omv 7.4.14-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.15 | compose 7.2.16 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thanks for the reply. I actually had tried creating the Dockerfile through the UI, but got the error "Name is in use by a compose file". So I thought I could only build a package using a compose file OR a dockerfile in the OMV UI. I then created the Dockerfile manually in the same directory where OMV created the compose YML file, but obviously that's not working.


    Do you mind explaining a bit more how to add this to the Dockerfile tab without getting that name collision error?

    • Official Post

    Do you mind explaining a bit more how to add this to the Dockerfile tab without getting that name collision error?

    Give the dockerfile or the compose a different name? The compose file name doesn't have to be the same as the image name.

    omv 7.4.14-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.15 | compose 7.2.16 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!