简体   繁体   English

Docker windows 容器中的塑料

[英]Plastic in Docker windows containers

I want to use plastic SCM in Docker windows containers.我想在 Docker windows 容器中使用塑料 SCM。 I searched in Plastic and found Linux containers docker file SO I want to try my own docker file for that I need to know the command to download the SCM installation file using PowerShell and install it without the GUI (arguments to pass for installation) via Powershell我在 Plastic 中搜索并找到了 Linux 容器 docker 文件,所以我想尝试我自己的 docker 文件,因为我需要知道使用 PowerShell 下载 SCM 安装文件的命令,并在没有 GUI 的情况下通过 Powershell 安装它(用于安装的参数)

This is the script I'm currently using for my windows image.这是我目前用于 Windows 图像的脚本。 I will warn you that it does take ~5-10 minutes to install during the build process, but everything works great besides that.我会警告你,在构建过程中安装确实需要大约 5-10 分钟,但除此之外一切都很好。 It works pretty simply, it creates a temp folder and uses the URL for the download to download the installer there, then runs the installer, and finally deletes the temp folder.它的工作原理非常简单,它创建一个临时文件夹并使用下载 URL 在那里下载安装程序,然后运行安装程序,最后删除临时文件夹。

    #This installs plastic

    $tempFolder = "C:\Temp"
    $plasticURL = "https://www.plasticscm.com/download/downloadinstaller/10.0.16.5882/plasticscm/windows/client"
    $installerName = "plasticinstalling.exe"

    New-Item $tempFolder -ItemType Directory -Force -ErrorAction Stop | Out-Null

    $installerLocation = (Join-Path -Path $tempFolder -ChildPath $installerName -ErrorAction Stop)

    Invoke-WebRequest -UseBasicParsing -Uri $plasticURL -OutFile $installerLocation -ErrorAction Stop

    Start-Process -FilePath $InstallerLocation -ArgumentList "--mode","unattended" -NoNewWindow -Wait -PassThru

    Remove-Item -Recurse $tempFolder -Force -ErrorAction Ignore

Then, in my docker file I just call the script:然后,在我的 docker 文件中,我只调用脚本:

    RUN powershell -Command C:\Scripts\installPlastic.ps1

Hope this helped and feel free to reach out with more questions.希望这会有所帮助,并随时与更多问题联系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM