Better docker config.

This commit is contained in:
Anna Rose Wiggins 2025-07-30 12:58:30 -04:00
parent bc9ac748d3
commit e85be32a76
2 changed files with 12 additions and 27 deletions

View file

@ -1,13 +1,12 @@
# A simple aliasing tool for performing remote docker operations over ssh # Convenience tool for setting DOCKER_HOST for remote docker operations over ssh.
# Usage: dcontrol <somehost.com> #
# Assumes you have key-based root login # Enable: dcontrol <somehost.com>
# Disable: dcontrol off
function dcontrol() { function dcontrol() {
if [ -z $1 ] || [ $1 == "off" ]; then if [ -z $1 ] || [ $1 == "off" ]; then
unalias docker 2> /dev/null
unset DOCKER_HOST unset DOCKER_HOST
return return
fi fi
export DOCKER_HOST=$1 export DOCKER_HOST=ssh://root@$1
alias docker="docker -H ssh://root@${DOCKER_HOST}"
} }

View file

@ -4,15 +4,6 @@
# Inserts a blank line between shell prompts # Inserts a blank line between shell prompts
add_newline = true add_newline = true
format = """
$username\
$hostname\
$directory\
${custom.dcontrol}\
$all
"""
# Replace the '' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character' [character] # The name of the module we are configuring is 'character'
success_symbol = '[\$](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green' success_symbol = '[\$](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
error_symbol = '[\$](bold red)' error_symbol = '[\$](bold red)'
@ -20,23 +11,21 @@ error_symbol = '[\$](bold red)'
[cmd_duration] [cmd_duration]
disabled = true disabled = true
[custom.dcontrol]
format='[\[$symbol $output\]]($style) '
command = "echo $DOCKER_HOST"
symbol=' '
style="bold red"
when = '[ "$DOCKER_HOST" != "" ]'
[directory] [directory]
truncation_length = 0 truncation_length = 0
format = '[$path]($style)[$read_only]($read_only_style)\] ' format = '[$path]($style)[$read_only]($read_only_style)\] '
[docker_context]
symbol = ' '
format = '[\[$symbol$context\]]($style) '
style = 'bold red'
[git_branch] [git_branch]
format = '[\[$symbol $branch\]]($style) ' format = '[\[$symbol$branch\]]($style) '
symbol = ' ' symbol = ' '
[golang] [golang]
format = '[$symbol]($style)' format = '[\[$symbol$version\]]($style) '
[hostname] [hostname]
format = '[@$hostname$ssh_symbol:]($style)' format = '[@$hostname$ssh_symbol:]($style)'
@ -46,9 +35,6 @@ ssh_only = false
[package] [package]
disabled = true disabled = true
[ruby]
format = '[$symbol]($style)'
[username] [username]
format = '\[[$user]($style)' format = '\[[$user]($style)'
style_user = 'yellow' style_user = 'yellow'