-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare fix for Docker Desktop in Windows
- Loading branch information
1 parent
0451cd9
commit 9953956
Showing
4 changed files
with
82 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Format, colorize docker ps output | ||
# Define a fixed width for the STATUS column | ||
$statusWidth = 30 | ||
|
||
# Capture the Docker output into a variable | ||
$dockerOutput = docker ps -f status=running -f status=exited --format "{{.Names}}`t{{.Status}}`t{{.Ports}}" | ||
|
||
# Print header with colors | ||
Write-Host ("NAME".PadRight(20) + "STATUS".PadRight($statusWidth) + "PORTS") -ForegroundColor Cyan -NoNewline | ||
Write-Host "" | ||
|
||
# Split the output into lines and loop over them | ||
$dockerOutput -split '\r?\n' | ForEach-Object { | ||
if ($_ -ne "") { | ||
$fields = $_ -split "`t" | ||
Write-Host ($fields[0].PadRight(20)) -NoNewline -ForegroundColor Yellow | ||
Write-Host ($fields[1].PadRight($statusWidth)) -NoNewline -ForegroundColor Green | ||
Write-Host ($fields[2]) -ForegroundColor Blue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Run genuser.sh within tpotinit, prepare path and file | ||
# Define the volume paths | ||
$homePath = $Env:USERPROFILE + "\tpotce" | ||
$nginxpasswdPath = $homePath + "\data\nginx\conf\nginxpasswd" | ||
|
||
# Ensure nginxpasswd file exists | ||
if (-Not (Test-Path $nginxpasswdPath)) { | ||
New-Item -ItemType File -Force -Path $nginxpasswdPath | ||
} | ||
|
||
# Run the Docker container without specifying UID / GID | ||
docker run -v "${homePath}:/data" --entrypoint bash -it dtagdevsec/tpotinit:24.04 "/opt/tpot/bin/genuser.sh" |