https://github.com/tadghh/koobernooties
Very useful no survey!
https://github.com/tadghh/koobernooties
Last synced: 3 months ago
JSON representation
Very useful no survey!
- Host: GitHub
- URL: https://github.com/tadghh/koobernooties
- Owner: tadghh
- Created: 2024-04-18T16:28:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-21T16:35:30.000Z (about 1 year ago)
- Last Synced: 2025-01-13T05:43:01.641Z (5 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# koobernooties
Very useful no survey!## Build the docker image in minikube
Why does Docker Hub need my dockerfile?
> [!NOTE]
> This removes the need to publish your docker image, saving bandwidth, power and improving your privacy.```powershell
function minik-build {
param (
[Parameter(Position = 0)]
[string]$Tag = "latest",[Parameter(Position = 1)]
[string]$Path = ".",
[Parameter(Position = 2)]
[switch]$NoCache
)# Collect Docker environment variables before Minikube setup
$originalEnv = @{}
Get-ChildItem Env:DOCKER_* | foreach { $originalEnv[$_.Name] = $_.Value }# Set up Minikube Docker context
& minikube -p minikube docker-env --shell powershell | Invoke-Expression
# Perform Docker build
if($NoCache){
docker build -t $Tag $Path --no-cache
}else{
docker build -t $Tag $Path
}# Restore Docker environment variables to their original state
foreach ($envVar in Get-ChildItem Env:DOCKER_*) {
$name = $envVar.Name
if (-not $originalEnv[$name]) {
Remove-Item -Path "Env:$name" -Force
continue
}$originalValue = $originalEnv[$name]
if ($envVar.Value -ne $originalValue) {
Set-Item -Path "Env:$name" -Value $originalValue
}
}
}
```