docker - 尝试为 plex 构建 dockerfile
问题描述
我是 docker 新手,并以此为例说明如何学习。我正在尝试创建一个 dockerfile,它允许我在我的 Windows 服务器上运行 plex。在 Plex 论坛上创建的一篇很棒的帖子描述了如何使用 powershell 执行任务,因此我想看看是否可以使用这些命令创建图像。
这是我到目前为止所拥有的:
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
我已经删除了格式化注释。所以我有两个问题,
首先:使用 docker build -t test_plex 时,这似乎没有运行。我收到以下错误:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: GetFileAttributesEx C:\Windows\System32\Dockerfile: The system cannot find the file specified.
第二:使用 PowerShell 会并行运行吗?还是有某种等待命令。
任何帮助/提示都会很棒,感谢您的宝贵时间(对不起,很长的帖子)
解决方案
看起来你正在运行docker build -t test_plex .
。C:\Windows\System32\
移动到仅包含 Dockerfile 的空文件夹,然后再次运行该命令。
这.
是构建上下文的位置,您也可以将该位置更改为不同的路径。
请记住,当您运行docker build -t test_plex .
“构建上下文”或运行时所在的目录时,它与构建相关。根据您的系统,您正在运行该命令的位置的所有文件都将被复制到构建虚拟机中。
推荐阅读
- node.js - Node JS - 运行 app.js 的自定义命令
- android - 无法打开opencv处理的图像android
- javascript - 如何使用 jQuery 动态更改输入内容
- android - React Native & VS Code - 断点没有被命中
- java - 如何控制 IntelliJ Scratch 文件的依赖关系?
- java - RecyclerView 不可见
- printing - 在 Yocto 上使用打印机
- java - 布局:装饰不能在百里香叶中解决
- python - 数组的最小边界矩形
- d3.js - 如何从财务图表的 x 轴中删除周末日期时间间隔?