Running Server-Media-Foundation in a container-requires restart RRS feed

  • Question

  • I'm trying to containerize an application that uses media foundation, so my first step is to create a base image with the feature installed.  I'm just trying to do this using commit right now, so I did this:

    • Created a new container from microsoft/windowsservercore and started it
    • ran docker exec -it c1 powershell to get a PS session into the container
    • Ran add-windowsfeature server-media-foundation inside the container to install the feature

    At this point, I get prompted that the server needs a restart to complete the install.  Now, if I exit the container (leaving it running), and try to commit, I get an error saying that I can't commit a running container.  If I stop the container, commit, then restart, the state is the same as before (media foundation shows uninstalled).  If I run restart-computer inside the container, the container stops, and when I restart it, it's in the original state (feature not installed). 

    Ideally, I want to be able to install all my prerequisites to a container, commit the change as a new image, and then deploy on top of that image from then on to avoid having to run add-windowsfeature on every container startup.  Once I have the process down I'll probably script it as a dockerfile, but committing like this seems like an easier way to get started and see if this will even work.

    So I suppose the main question at this point is-how can I run an application that depends on a server feature that requires a restart in a container?

    Wednesday, July 5, 2017 6:58 PM

All replies

  • Please take a look at the proposed answer to
    • Edited by DouglasGG Wednesday, July 5, 2017 11:53 PM
    Wednesday, July 5, 2017 11:53 PM
  • Thanks!  I actually managed managed to get the feature installed into a base image, along with the UCMA runtime and CRT, so I was actually able to get slightly further in this endeavour.  I'll give your solution a try for creating a dockerfile build though!
    Thursday, July 6, 2017 2:05 PM