Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Bob Tanner
packer-windows
Commits
15ea66b4
Unverified
Commit
15ea66b4
authored
Feb 12, 2017
by
Stefan Scherer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust Docker installation for Win10 and Win2016
parent
e88b13e8
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
28 deletions
+43
-28
build_windows_10.sh
build_windows_10.sh
+5
-5
build_windows_2016_docker.sh
build_windows_2016_docker.sh
+3
-1
scripts/docker/10/install-containers-feature.ps1
scripts/docker/10/install-containers-feature.ps1
+2
-0
scripts/docker/10/install-docker.ps1
scripts/docker/10/install-docker.ps1
+2
-5
scripts/docker/2016/install-containers-feature.ps1
scripts/docker/2016/install-containers-feature.ps1
+9
-0
scripts/docker/2016/install-docker.ps1
scripts/docker/2016/install-docker.ps1
+12
-0
scripts/docker/docker-pull-async.ps1
scripts/docker/docker-pull-async.ps1
+1
-1
scripts/docker/enable-winrm.ps1
scripts/docker/enable-winrm.ps1
+2
-10
scripts/docker/install-containers-feature.ps1
scripts/docker/install-containers-feature.ps1
+0
-2
windows_10_docker.json
windows_10_docker.json
+3
-3
windows_2016_docker.json
windows_2016_docker.json
+4
-1
No files found.
build_windows_10.sh
View file @
15ea66b4
#!/bin/bash
#packer build --only=vmware-iso windows_10.json
# my own license
#packer build --only=vmware-iso --var iso_url=~/packer_cache/Win10_1607_English_x64.iso --var iso_checksum=99fd8082a609997ae97a514dca22becf20420891 --var autounattend=./tmp/10/Autounattend.xml windows_10.json
# Windows 10 Insider 15002
# packer build --only=vmware-iso --var iso_url=~/packer_cache/Windows10_InsiderPreview_EnterpriseVL_x64_en-us_15002.iso --var iso_checksum=86fdf5c4061edde17a6aece0590225e6880b39ee --var autounattend=./tmp/10_insider/Autounattend.xml windows_10.json
# Windows 10 Pro own license
#packer build --only=vmware-iso --var iso_url=~/packer_cache/my/Win10_1607_English_x64.iso --var iso_checksum=99fd8082a609997ae97a514dca22becf20420891 --var autounattend=./tmp/10_pro/Autounattend.xml windows_10.json
# Windows 10 Insider 15025
packer build
--only
=
vmware-iso
--var
iso_url
=
~/packer_cache/Windows10_InsiderPreview_EnterpriseVL_x64_en-us_15025.iso windows_10_insider.json
# Windows 10 Enterprise MSDN
#packer build --only=vmware-iso --var iso_url=~/packer_cache/msdn/en_windows_10_enterprise_version_1607_updated_jan_2017_x64_dvd_9714415.iso --var iso_checksum=97164DD5C1C933BAEF89A4BDE93D544256134FE4 --var iso_checksum_type=sha1 --var autounattend=./tmp/10/Autounattend.xml windows_10.json
build_windows_2016_docker.sh
View file @
15ea66b4
#!/bin/bash
# packer build --only=vmware-iso --var iso_url=~/packer_cache/14393.0.160715-1616.RS1_RELEASE_SERVER_EVAL_X64FRE_EN-US.ISO windows_2016_docker.json
packer build
--only
=
vmware-iso
--var
iso_url
=
~/packer_cache/en_windows_server_2016_x64_dvd_9327751.iso
--var
iso_checksum
=
91d7b2ebcff099b3557570af7a8a5cd6
--var
autounattend
=
./tmp/2016/Autounattend.xml windows_2016_docker.json
# MSDN ISO
packer build
--only
=
vmware-iso
--var
iso_url
=
~/packer_cache/msdn/en_windows_server_2016_x64_dvd_9718492.iso
--var
iso_checksum
=
F185197AF68FAE4F0E06510A4579FC511BA27616
--var
iso_checksum_type
=
sha1
--var
autounattend
=
./tmp/2016_noupdate/Autounattend.xml windows_2016_docker.json
scripts/docker/install-containers-feature
-windows10
.ps1
→
scripts/docker/
10/
install-containers-feature.ps1
View file @
15ea66b4
# https://msdn.microsoft.com/de-de/virtualization/windowscontainers/quick_start/quick_start_windows_10
Write-Host
"Install Containers feature"
Enable-WindowsOptionalFeature
-Online
-FeatureName
containers
-All
-NoRestart
Write-Host
"Install Hyper-V feature"
Enable-WindowsOptionalFeature
-Online
-FeatureName
Microsoft-Hyper-V
-All
-NoRestart
sc.exe
config
winrm
start
=
delayed-auto
scripts/docker/install-docker.ps1
→
scripts/docker/
10/
install-docker.ps1
View file @
15ea66b4
Set-ExecutionPolicy
Bypass
-scope
Process
New-Item
-Type
Directory
-Path
"
$(
$
env
:
ProgramFiles
)
\docker"
# wget -outfile $env:TEMP\docker-1.13.1.zip "https://dockermsft.blob.core.windows.net/dockercontainer/docker-1-13-1.zip"
Write-Host
"Downloading docker ..."
wget
-outfile
$
env
:
TEMP
\docker-1.13.1.zip
"https://get.docker.com/builds/Windows/x86_64/docker-1.13.1.zip"
Expand-Archive
-Path
$
env
:
TEMP
\docker-1.13.1.zip
-DestinationPath
$
env
:
TEMP
-Force
copy
$
env
:
TEMP
\docker\
*.
exe
$
env
:
ProgramFiles
\docker
Remove-Item
$
env
:
TEMP
\docker-1.13.1.zip
[
Environment
]::
SetEnvironmentVariable
(
"Path"
,
$
env
:
Path
+
";
$(
$
env
:
ProgramFiles
)
\docker"
,
[
EnvironmentVariableTarget
]::
Machine
)
$
env
:
Path
=
$
env
:
Path
+
";
$(
$
env
:
ProgramFiles
)
\docker"
Write-Host
"Registering docker service ..."
.
dockerd
--register-service
-H
npipe://
-H
0.0.0.0:2375
-G
docker
Write-Host
"Fix --restart=always for reboot ..."
# see https://github.com/docker/docker/issues/27544
&
sc.exe
config
Docker
depend
=
LanmanWorkstation
Start-Service
Docker
scripts/docker/2016/install-containers-feature.ps1
0 → 100644
View file @
15ea66b4
Write-Host
"Install Containers feature"
Install-WindowsFeature
-Name
Containers
if
((
GWMI
Win32_Processor
)
.
VirtualizationFirmwareEnabled
[
0
]
-and
(
GWMI
Win32_Processor
)
.
SecondLevelAddressTranslationExtensions
[
0
])
{
Write-Host
"Install Hyper-V feature"
Install-WindowsFeature
-Name
Hyper-V
-IncludeManagementTools
}
else
{
Write-Host
"Skipping installation of Hyper-V feature"
}
scripts/docker/2016/install-docker.ps1
0 → 100644
View file @
15ea66b4
$ProgressPreference
=
'SilentlyContinue'
Set-ExecutionPolicy
Bypass
-scope
Process
New-Item
-Type
Directory
-Path
"
$(
$
env
:
ProgramFiles
)
\docker"
wget
-outfile
$
env
:
TEMP
\docker-1.13.1.zip
"https://dockermsft.blob.core.windows.net/dockercontainer/docker-1-13-1.zip"
Expand-Archive
-Path
$
env
:
TEMP
\docker-1.13.1.zip
-DestinationPath
$
env
:
TEMP
-Force
copy
$
env
:
TEMP
\docker\
*.
exe
$
env
:
ProgramFiles
\docker
Remove-Item
$
env
:
TEMP
\docker-1.13.1.zip
[
Environment
]::
SetEnvironmentVariable
(
"Path"
,
$
env
:
Path
+
";
$(
$
env
:
ProgramFiles
)
\docker"
,
[
EnvironmentVariableTarget
]::
Machine
)
$
env
:
Path
=
$
env
:
Path
+
";
$(
$
env
:
ProgramFiles
)
\docker"
.
dockerd
--register-service
-H
npipe://
-H
0.0.0.0:2375
-G
docker
Start-Service
docker
scripts/docker/docker-pull-async.ps1
View file @
15ea66b4
...
...
@@ -3,7 +3,7 @@ function DockerPull {
Write-Host
Installing
$image
...
$j
=
Start-Job
-ScriptBlock
{
docker
pull
$args
[
0
]
}
-ArgumentList
$image
while
(
$j
.
JobStateInfo
.
state
-ne
"Completed"
)
{
while
(
$j
.
JobStateInfo
.
state
-ne
"Completed"
-And
$j
.
JobStateInfo
.
state
-ne
"Failed"
)
{
Write-Host
$j
.
JobStateInfo
.
state
Start-Sleep
10
}
...
...
scripts/docker/enable-winrm.ps1
View file @
15ea66b4
...
...
@@ -7,17 +7,9 @@ winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm
set
winrm/config/service/auth
'@{Basic="true"}'
winrm
set
winrm/config/client/auth
'@{Basic="true"}'
winrm
set
winrm/config/listener
?
Address
=*+
Transport
=
HTTP
'@{Port="5985"}'
# Set-Service winrm -startuptype "auto"
# Restart-Service winrm
Write-Host
"Install Containers"
Install-WindowsFeature
-Name
Containers
if
((
GWMI
Win32_Processor
)
.
VirtualizationFirmwareEnabled
[
0
]
-and
(
GWMI
Win32_Processor
)
.
SecondLevelAddressTranslationExtensions
[
0
])
{
Write-Host
"Install Hyper-V"
Install-WindowsFeature
-Name
Hyper-V
-IncludeManagementTools
}
else
{
Write-Host
"Skipping installation of Hyper-V"
if
(
Test-Path
A:\install-containers-feature.ps1
)
{
.
A:\install-containers-feature.ps1
}
Stop-Service
winrm
...
...
scripts/docker/install-containers-feature.ps1
deleted
100644 → 0
View file @
e88b13e8
Write-Host
"Install Containers feature"
Install-WindowsFeature
-Name
Containers
windows_10_docker.json
View file @
15ea66b4
...
...
@@ -26,7 +26,7 @@
{
"type"
:
"powershell"
,
"scripts"
:
[
"./scripts/docker/install-containers-feature
-windows10
.ps1"
"./scripts/docker/
10/
install-containers-feature.ps1"
]
},
{
...
...
@@ -35,9 +35,8 @@
{
"type"
:
"powershell"
,
"scripts"
:
[
"./scripts/docker/enable-winrm.ps1"
,
"./scripts/docker/add-docker-group.ps1"
,
"./scripts/docker/install-docker.ps1"
,
"./scripts/docker/
10/
install-docker.ps1"
,
"./scripts/docker/docker-pull-async.ps1"
,
"./scripts/docker/open-docker-insecure-port.ps1"
,
"./scripts/docker/remove-docker-key-json.ps1"
,
...
...
@@ -48,6 +47,7 @@
"type"
:
"windows-shell"
,
"scripts"
:
[
"./scripts/uac-enable.bat"
,
"./scripts/set-winrm-automatic.bat"
,
"./scripts/compact.bat"
]
}
...
...
windows_2016_docker.json
View file @
15ea66b4
...
...
@@ -16,6 +16,7 @@
"./scripts/disable-screensaver.ps1"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/docker/enable-winrm.ps1"
,
"./scripts/docker/2016/install-containers-feature.ps1"
,
"./scripts/microsoft-updates.bat"
,
"./scripts/win-updates.ps1"
],
...
...
@@ -55,6 +56,7 @@
"./scripts/disable-screensaver.ps1"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/docker/enable-winrm.ps1"
,
"./scripts/docker/2016/install-containers-feature.ps1"
,
"./scripts/microsoft-updates.bat"
,
"./scripts/win-updates.ps1"
],
...
...
@@ -91,6 +93,7 @@
"./scripts/disable-screensaver.ps1"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/docker/enable-winrm.ps1"
,
"./scripts/docker/2016/install-containers-feature.ps1"
,
"./scripts/microsoft-updates.bat"
,
"./scripts/win-updates.ps1"
,
"./scripts/oracle-cert.cer"
...
...
@@ -141,7 +144,7 @@
"type"
:
"powershell"
,
"scripts"
:
[
"./scripts/docker/add-docker-group.ps1"
,
"./scripts/docker/install-docker.ps1"
,
"./scripts/docker/
2016/
install-docker.ps1"
,
"./scripts/docker/docker-pull-async.ps1"
,
"./scripts/docker/open-docker-insecure-port.ps1"
,
"./scripts/docker/remove-docker-key-json.ps1"
,
...
...
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