https://github.com/piotr-rojek/devopsifyme-containersterminal
https://github.com/piotr-rojek/devopsifyme-containersterminal
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/piotr-rojek/devopsifyme-containersterminal
- Owner: piotr-rojek
- License: apache-2.0
- Created: 2023-01-23T20:06:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-24T21:19:19.000Z (about 2 years ago)
- Last Synced: 2024-08-13T07:05:40.822Z (8 months ago)
- Language: PowerShell
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - piotr-rojek/devopsifyme-containersterminal - (PowerShell)
README
# DevOpsify Me - Containers Terminal
Tool for adding profiles to Windows Terminal related to containers, supporting following scenarios
* attach to a shell of a running container
* start a new shell in a container for an already download / predefined image
* automatically mount C: drive for new containers, as WSL wouldEvery 10 seconds configuration is refreshed and exited containers are removed. Note that you have to close session by typing 'exit', otherwise container will continue to run in detached state. Assumption is that tool will be running on a WSL instance on a Windows machine, and that Windows Terminal is already installed.
More information on [Blog](https://devopsifyme.com) and [Github](https://github.com/piotr-rojek/devopsifyme-containersterminal).
## Running
```ps
$fragmentPath = "Users/$($env:USERNAME)/AppData/Local/Microsoft/Windows Terminal/Fragments/DevOpsifyMe.ContainersTerminal"
$windowsPath = "c:/$fragmentPath"
$linuxPath = "/mnt/c/$fragmentPath"
New-Item -Type Directory $windowsPath -Force | Out-Nulldocker run `
-d --restart=always `
--name containersterminal `
-e FRAGMENT_WIN_PATH=$windowsPath `
-e KNOWN_IMAGES='debian;ubuntu;golang' `
-v /run/docker.sock:/var/run/docker.sock `
-v "$($linuxPath):/output" `
devopsifyme/containersterminal:latest
```## Environmental Variables
* CONTAINER_LABEL - label used to mark containers created by this tool
* FRAGMENT_WIN_PATH - full path on Windows host where generated fragment is stored, this is needed for ICON path to be correct
* KNOWN_IMAGES - ';' separated list of images to be always present on the list
* KNOWN_IMAGE_PROFILES_ENABLED - true/false, should profiles based on known images be generated
* KNOWN_IMAGE_PROFILES_HIDDEN - true/false, should profiles based on known images be hidden
* IMAGE_PROFILES_ENABLED - true/false, should profiles based on local images be generated
* IMAGE_PROFILES_HIDDEN - true/false, should profiles based on local images be hidden
* IMAGE_PROFILES_FILTER - ';' separated list of filters used to limit shown images
* CONTAINER_PROFILES_ENABLED - true/false, should profiles based on running containers be generated
* CONTAINER_PROFILES_HIDDEN - true/false, should profiles based on running containers be hidden
* CONTAINER_PROFILES_FILTER - ';' separated list of filters used to limit shown containers