4
4
# 2. docker build -t <image_name> .
5
5
# The resulting image is ready to run the pyinstaller on container start and drop hubble<version>.exe
6
6
# in a local directory. Mount c:\data volume into a directory on the host to access the package.
7
- # To run the container:
7
+ # To run the container:
8
8
# 3. Copy over any other items you want to include with hubble and place them in <host folder>/opt
9
9
# 4. docker run -it --rm -v <host folder>:c:\data <image_name>
10
10
#build docker image from windowscore
@@ -31,7 +31,9 @@ VOLUME C:/data
31
31
COPY pyinstaller-requirements.txt c:/temp/
32
32
COPY hubble.conf C:/temp/
33
33
#install Chocolatey, then git and osquery
34
- RUN powershell.exe -Command Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString("$env:CHOCO_URL"))
34
+ RUN powershell.exe -Command Set-ExecutionPolicy Bypass -Scope Process -Force; \
35
+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12'; \
36
+ iex ((New-Object System.Net.WebClient).DownloadString("$env:CHOCO_URL"));
35
37
RUN powershell.exe -Command choco install git nssm -y;
36
38
RUN powershell.exe -Command choco install osquery --version 3.4.0 -y;
37
39
@@ -52,18 +54,18 @@ RUN powershell.exe -Command git clone "$env:HUBBLE_GIT_URL"; \
52
54
Push-Location hubble; \
53
55
git checkout "$env:HUBBLE_CHECKOUT"; \
54
56
pop-location;
55
-
57
+
56
58
#Use pip to install hubble dependencies
57
59
RUN powershell.exe -Command pip install -r pyinstaller-requirements.txt;
58
-
60
+
59
61
# Modify gitfs fix for incorrect path variables until fix has been upstreamed
60
62
RUN powershell.exe -Command If (!(Test-Path C:/Python27/Lib/site-packages/salt)) {Copy-Item C:/temp/salt/salt -Destination C:/Python27/Lib/site-packages/ -Recurse -Force}; \
61
63
$gitfsFile = Get-Content C:\Python27\Lib\site-packages\salt\utils\gitfs.py; \
62
64
$gitfsFile = $gitfsFile -replace 'files.add\\(add_mountpoint\\(relpath\\(repo_path\\)\\)\\)','files.add("/".join(repo_path.partition(".:\\")[2].split(os.sep)))'; \
63
65
Set-Content -Path C:\Python27\Lib\site-packages\salt\utils\gitfs.py -Value $gitfsFile -Force
64
66
#Get vcredist prereq for hubble
65
67
RUN powershell.exe -Command \
66
- $ProgressPreference = 'SilentlyContinue'; \
68
+ $ProgressPreference = 'SilentlyContinue'; \
67
69
Invoke-WebRequest -Uri 'http://repo.saltstack.com/windows/dependencies/64/vcredist_x64_2008_mfc.exe' -OutFile "C:/temp/hubble/pkg/windows/vcredist.exe"
68
70
#Create pyionstaller spec and edit it to work with windows
69
71
CMD powershell.exe -Command Push-Location C:/temp/hubble; \
@@ -85,11 +87,11 @@ CMD powershell.exe -Command Push-Location C:/temp/hubble; \
85
87
If (Test-Path C:/data/hubble.conf) {Copy-Item C:/data/hubble.conf -Destination ./hubble/dist/hubble/etc/hubble/ -Force}; \
86
88
If (Test-Path C:/data/opt) {Copy-Item C:/data/opt -Destination './hubble/dist/hubble/' -Recurse -Force}; \
87
89
Move-Item 'C:/temp/hubble/pkg/windows/osqueryd_safe_permissions.ps1' -Destination './hubble/dist/hubble/' -Force; \
90
+ Move-Item 'C:/temp/hubble/pkg/windows/hubble_config_permissions.ps1' -Destination './hubble/dist/hubble/' -Force; \
88
91
Move-Item 'C:/temp/hubble/pkg/windows/prerequisites.ps1' -Destination './hubble/dist/hubble/' -Force; \
89
92
#Build the installer
90
93
Push-Location 'C:/Program Files (x86)/NSIS'; \
91
94
./makensis.exe /DHubbleVersion="$env:HUBBLE_CHECKOUT" 'C:/temp/hubble/pkg/windows/hubble-Setup.nsi'; \
92
95
Get-FileHash -Path C:/temp/hubble/pkg/windows/Hubble*exe -Algorithm SHA256 ^| Out-File C:/temp/hubble/pkg/windows/hubble_windows.sha256; \
93
96
Copy-Item C:/temp/hubble/pkg/windows/Hubble*exe -Destination C:/data/; \
94
- Copy-Item C:/temp/hubble/pkg/windows/hubble_windows.sha256 -Destination C:/data/;
95
-
97
+ Copy-Item C:/temp/hubble/pkg/windows/hubble_windows.sha256 -Destination C:/data/;
0 commit comments