https://github.com/fs-frost/gocker
CLI tool to execute commands on docker containers.
https://github.com/fs-frost/gocker
cli docker golang
Last synced: 2 months ago
JSON representation
CLI tool to execute commands on docker containers.
- Host: GitHub
- URL: https://github.com/fs-frost/gocker
- Owner: FS-Frost
- Created: 2022-06-01T18:54:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-28T21:05:30.000Z (about 3 years ago)
- Last Synced: 2025-01-05T09:32:21.773Z (over 1 year ago)
- Topics: cli, docker, golang
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gocker
CLI tool to execute commands on docker containers.
## Requirements
- [Go](https://go.dev/)
- [Docker](https://www.docker.com/)
## Install
```shell
go install github.com/FS-Frost/gocker@latest
```
## Usage
```shell
gocker -help
gocker --help
```
Prints:
```shell
Repository: https://www.github.com/FS-Frost/gocker
Config: /home/myself/.gocker/config.json
Usage:
a) With flags:
-cmd string
command to execute (default "bash")
-config
prints user config
-container string
container name
-help
prints usage
-update
updates gocker installation
-version
prints current version
Example: 'gocker -container mysql -cmd "ls -l"'
b) Without flags:
b1) Interactive shell:
gocker
b2) Custom command:
gocker [container-name] [command] [arg1]...[argN]
Example: 'gocker mysql ls -l'
```
### Example Output
```
Containers:
1. golang
2. ubuntu
3. node
Enter container number or name: 2
Container: ubuntu (403c44416624)
Commands:
1. bash
2. sh
3. other
Enter command number or raw command to execute: 1
Command: bash
/usr/bin/docker exec -it ubuntu bash
root@403c44416624:/var/www/html#
```