Search code examples
dockerdockerfileplex

Trying to build a dockerfile for plex


I am new to docker and using this as an example on how to learn. I am trying to create a dockerfile which would allow me to run plex on my windows sever. An awesome post created on the Plex forums describes how to perform the tasks using powershell, and so I wanted to see if it would be possible to create an image using these commands.

Here is what I have so far:

FROM microsoft/windowsservercore

RUN Get-ChildItem "$Env:SystemRoot\Servicing\Packages\*Media*.mum" | ForEach-Object { (Get-Content $_) -replace 'required','no' | Set-Content $_}
RUN Add-WindowsFeature Server-Media-Foundation; 

RUN Invoke-WebRequest -OutFile Plex-Media-Server-1.12.3.4973-215c28d86.exe "https://downloads.plex.tv/plex-media-server/1.12.3.4973-215c28d86/Plex-Media-Server-1.12.3.4973-215c28d86.exe" -UseBasicParsing;

RUN .\plex.exe /quiet 
RUN start 'C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe'

EXPOSE 32400/tcp

I have removed comments for formatting. So I have two questions,

first : this does not seem to run when using docker build -t test_plex . I get the following error:

unable to prepare context: unable to     evaluate symlinks in Dockerfile path: GetFileAttributesEx C:\Windows\System32\Dockerfile: The system cannot find the file specified.

second: using PowerShell would this all run in parallel? or is there some kind of wait command.

Any help/tips would be great, thanks for your time (sorry about long post)


Solution

  • It looks like you're running docker build -t test_plex . in C:\Windows\System32\. Move to an empty folder with just your Dockerfile and run the command again.

    The . is the location of your build context, you can also change that location to a different path.

    Keep in mind that when you run docker build -t test_plex . the "build context" or the directory that you're in when you run it is relevant to the build. Depending on your system all the files at the location you're running that command will be copied into the build vm.