Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/startautomating/rocker
Rock Docker with PowerShell
https://github.com/startautomating/rocker
command-line-tool docker docker-compose orchestration powershell powershell-module
Last synced: 8 days ago
JSON representation
Rock Docker with PowerShell
- Host: GitHub
- URL: https://github.com/startautomating/rocker
- Owner: StartAutomating
- License: mit
- Created: 2024-04-03T02:43:05.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T05:42:10.000Z (about 2 months ago)
- Last Synced: 2024-09-18T07:41:49.099Z (about 2 months ago)
- Topics: command-line-tool, docker, docker-compose, orchestration, powershell, powershell-module
- Language: PowerShell
- Homepage:
- Size: 194 KB
- Stars: 17
- Watchers: 2
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## Rocker
Rock Docker with PowerShell
### What is Rocker?
Rocker is a PowerShell module that makes Docker a bit cooler.
It allows docker to work with PowerShell's object pipeline, so you can pipe one step into the next.
It also gives you tab completion for any command in docker.
### Installing and Importing
~~~PowerShell
Install-Module Rocker -Scope CurrentUser
Import-Module Rocker -Force -PassThru
~~~### Examples
~~~PowerShell
# Get Docker Help
docker help~~~
~~~PowerShell
# Get Docker Help for a specific command
docker help run~~~
~~~PowerShell
# Run a script in a container
docker run mcr.microsoft.com/powershell {
"Hello from Docker! $pid"
}~~~
~~~PowerShell
# Run an nginx container, publishing port 8080 on the host.
docker run --detach @{8080=80} nginx~~~
~~~PowerShell
# Run a script in a container,
# mount the current directory,
# and set an environment variable.
docker run @{
"$pwd"="/mnt"
message='Hello from Docker!'
} mcr.microsoft.com/powershell {
"$($env:message) $(@(Get-ChildItem /mnt -recurse -File).Length) files mounted."
}~~~
~~~PowerShell
# List all containers
docker container ls |
docker diff # show their differences from the image.~~~
~~~PowerShell
# List all containers,
docker container ls |
docker container pause
# and pause them.~~~
~~~PowerShell
# List all containers,
docker container ls |
docker container unpause
# and start them up again.~~~
~~~PowerShell
# List all containers.
docker container ls |
docker history
# get their history~~~
~~~PowerShell
# Stop all running containers.
docker container ls |
docker container stop~~~
~~~PowerShell
# Get system disk information
docker system df~~~
~~~PowerShell
# Get system info
docker system info~~~