Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
packer-windows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bob Tanner
packer-windows
Commits
e454900f
Commit
e454900f
authored
Jun 27, 2016
by
Patrick Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving to newer install process
parent
7e13d479
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
117 deletions
+12
-117
answer_files/2016/Autounattend.xml
answer_files/2016/Autounattend.xml
+2
-2
scripts/docker/enable-docker-insecure.ps1
scripts/docker/enable-docker-insecure.ps1
+1
-5
scripts/docker/enable-winrm.ps1
scripts/docker/enable-winrm.ps1
+2
-0
scripts/docker/install-docker.ps1
scripts/docker/install-docker.ps1
+7
-108
windows_2016_docker.json
windows_2016_docker.json
+0
-2
No files found.
answer_files/2016/Autounattend.xml
View file @
e454900f
...
...
@@ -191,7 +191,7 @@
-->
<!-- END WITHOUT WINDOWS UPDATES -->
<!-- WITH WINDOWS UPDATES -->
<SynchronousCommand
wcm:action=
"add"
>
<
!-- <
SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c a:\microsoft-updates.bat</CommandLine>
<Order>98</Order>
<Description>Enable Microsoft Updates</Description>
...
...
@@ -201,7 +201,7 @@
<Description>Install Windows Updates</Description>
<Order>100</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
</SynchronousCommand>
-->
<!-- END WITH WINDOWS UPDATES -->
</FirstLogonCommands>
<OOBE>
...
...
scripts/docker/enable-docker-insecure.ps1
View file @
e454900f
Write-Host
"WARNING: DO NOT USE DOCKER IN PRODUCTION WITHOUT TLS"
Write-Host
"
Enabl
ing Docker insecure port 2375"
Write-Host
"
Open
ing Docker insecure port 2375"
if
(
!
(
Get-NetFirewallRule
|
where
{
$_
.
Name
-eq
"Dockerinsecure2375"
}))
{
New-NetFirewallRule
-Name
"Dockerinsecure2375"
-DisplayName
"Docker insecure on TCP/2375"
-Protocol
tcp
-LocalPort
2375
-Action
Allow
-Enabled
True
}
Write-Host
"Enabling Docker to listen on insecure port 2375"
cp
C:\ProgramData\docker\runDockerDaemon.cmd
C:\ProgramData\docker\runDockerDaemon.cmd.bak
cat
C:\ProgramData\docker\runDockerDaemon.cmd.bak
|
%
{
$_
-replace
'^dockerd -H npipe://\s*$'
,
'dockerd -H npipe:// -H 0.0.0.0:2375'
}
|
Set-Content
C:\ProgramData\docker\runDockerDaemon.cmd
scripts/docker/enable-winrm.ps1
View file @
e454900f
...
...
@@ -12,6 +12,8 @@ winrm set winrm/config/listener?Address=*+Transport=HTTP '@{Port="5985"}'
Write-Host
"Install Containers"
Install-WindowsFeature
-Name
Containers
# TODO: Better option - use msinfo32 or coreinfo to see if virtualization instructions are supported
if
(
Test-Path
a:\oracle-cert.cer
)
{
Write-Host
"Skipping installation of Hyper-V in VirtualBox basebox"
}
else
{
...
...
scripts/docker/install-docker.ps1
View file @
e454900f
# https://msdn.microsoft.com/virtualization/windowscontainers/deployment/deployment
wget
https://aka.ms/tp5/Install-ContainerHost
-OutFile
c:\Install-ContainerHost.ps1
-UseBasicParsing
Install-PackageProvider
ContainerImage
-Force
# create a Task Scheduler task which is also able to run in battery mode due
# to host notebooks working in battery mode.
function
Run-Interactive
{
param
(
[
string
]
$commandline
)
$xml
=
@"
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2014-03-27T13:53:05</Date>
<Author>vagrant</Author>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<StartBoundary>2014-03-27T00:00:00</StartBoundary>
<Enabled>true</Enabled>
</TimeTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>vagrant</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>P3D</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>powershell.exe</Command>
<Arguments>-Command
$commandline
; sleep 15</Arguments>
</Exec>
</Actions>
</Task>
"@
$XmlFile
=
$
env
:
Temp
+
"\InstallContainerHost.xml"
Write-Host
"Write Task '
$commandline
' to
$XmlFile
"
$xml
|
Out-File
$XmlFile
&
schtasks
/Delete
/F
/TN
InstallContainerHost
&
schtasks
/Create
/TN
InstallContainerHost
/XML
$XmlFile
&
schtasks
/Run
/TN
InstallContainerHost
Write-Host
"Waiting until Scheduled Task InstallContainerHost task is no longer running"
do
{
Start-Sleep
-Seconds
5
}
while
(
(
&
schtasks
/query
/tn
InstallContainerHost
|
Select-String
-Pattern
"InstallContainerHost"
-SimpleMatch
)
-like
"*Running*"
)
if
((
&
schtasks
/query
/tn
InstallContainerHost
|
Select-String
-Pattern
"InstallContainerHost"
-SimpleMatch
)
-like
"*Could not start*"
)
{
Write-Error
"Scheduled Task InstallContainerHost could not start!"
}
else
{
Write-Host
"Scheduled Task InstallContainerHost '
$commandline
' finished"
}
cat
C:\progress.txt
$halt
=
0
if
(
$halt
)
{
Write-Host
"Delete me to continue"
|
Out-File
-FilePath
$
env
:
USERPROFILE
\Desktop\deleteme.txt
Write-Host
"Pausing until
$
env
:
USERPROFILE
\Desktop\deleteme.txt gets deleted"
do
{
Start-Sleep
-Seconds
5
}
while
(
Test-Path
$
env
:
USERPROFILE
\Desktop\deleteme.txt
)
}
&
schtasks
/Delete
/F
/TN
InstallContainerHost
}
if
(
Test-Path
a:\oracle-cert.cer
)
{
Write-Host
"Skip installation of Hyper-V on VirtualBox Container Host"
$installOptions
=
""
}
else
{
Write-Host
"Add installation of Hyper-V on Container Host"
$installOptions
=
"-HyperV"
}
if
(
Test-Path
a:\oracle-cert.cer
)
{
Write-Host
"Skipping NanoServer container image"
}
else
{
Run-Interactive
-commandline
"C:\Install-ContainerHost.ps1 -HyperV | Tee-Object -FilePath C:\progress.txt"
}
Run-Interactive
-commandline
"C:\Install-ContainerHost.ps1 | Tee-Object -FilePath C:\progress.txt"
restart-service
docker
# https://msdn.microsoft.com/de-de/virtualization/windowscontainers/quick_start/quick_start_windows_10
New-Item
-Type
Directory
-Path
'C:\Program Files\docker\'
Invoke-WebRequest
https://aka.ms/tp5/b/dockerd
-OutFile
$
env
:
ProgramFiles
\docker\dockerd.exe
Invoke-WebRequest
https://aka.ms/tp5/b/docker
-OutFile
$
env
:
ProgramFiles
\docker\docker.exe
[
Environment
]::
SetEnvironmentVariable
(
"Path"
,
$
env
:
Path
+
";C:\Program Files\Docker"
,
[
EnvironmentVariableTarget
]::
Machine
)
.
'C:\Program Files\docker\dockerd'
--register-service
-H
npipe://
-H
0.0.0.0:2375
Start-Service
Docker
windows_2016_docker.json
View file @
e454900f
...
...
@@ -134,7 +134,6 @@
"type"
:
"powershell"
,
"scripts"
:
[
"./scripts/docker/install-docker.ps1"
,
"./scripts/docker/patch-boot-time-for-containers.ps1"
,
"./scripts/docker/enable-docker-insecure.ps1"
,
"./scripts/docker/add-docker-group.ps1"
,
"./scripts/docker/remove-docker-key-json.ps1"
...
...
@@ -143,7 +142,6 @@
{
"type"
:
"windows-shell"
,
"scripts"
:
[
"./scripts/set-winrm-automatic.bat"
,
"./scripts/uac-enable.bat"
,
"./scripts/compile-dotnet-assemblies.bat"
,
"./scripts/compact.bat"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment