Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_bash: start bash in a container #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ Based on code in Mate-HUD.
Attach to a running `tmux` session or create a new one.
Since this script starts a new terminal it can also been used with a keybinding from your favorite window-manager.

## docker_bash.sh

Start a Bash session in a Docker container. Like `tmux_session.sh` this opens a new terminal and is suitable for keybinding.

### Screenshot
![Docker-Bash](docker_bash.png)

### Usage

Interactive usage
Expand Down
Binary file added docker_bash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docker_bash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/bash

CONTAINER=$(docker ps | tail -n +2 | rofi -dmenu -p 'Select container' | cut -d ' ' -f 1)

if [[ -z "$CONTAINER" ]]; then
echo 'Cancel'
else
rofi-sensible-terminal -e "docker exec -ti $CONTAINER /bin/bash" &
fi