Better docker config.
This commit is contained in:
parent
bc9ac748d3
commit
e85be32a76
2 changed files with 12 additions and 27 deletions
|
@ -1,13 +1,12 @@
|
|||
# A simple aliasing tool for performing remote docker operations over ssh
|
||||
# Usage: dcontrol <somehost.com>
|
||||
# Assumes you have key-based root login
|
||||
# Convenience tool for setting DOCKER_HOST for remote docker operations over ssh.
|
||||
#
|
||||
# Enable: dcontrol <somehost.com>
|
||||
# Disable: dcontrol off
|
||||
|
||||
function dcontrol() {
|
||||
if [ -z $1 ] || [ $1 == "off" ]; then
|
||||
unalias docker 2> /dev/null
|
||||
unset DOCKER_HOST
|
||||
return
|
||||
fi
|
||||
export DOCKER_HOST=$1
|
||||
alias docker="docker -H ssh://root@${DOCKER_HOST}"
|
||||
export DOCKER_HOST=ssh://root@$1
|
||||
}
|
||||
|
|
|
@ -4,15 +4,6 @@
|
|||
# Inserts a blank line between shell prompts
|
||||
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'
|
||||
success_symbol = '[\$](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
|
||||
error_symbol = '[\$](bold red)'
|
||||
|
@ -20,23 +11,21 @@ error_symbol = '[\$](bold red)'
|
|||
[cmd_duration]
|
||||
disabled = true
|
||||
|
||||
[custom.dcontrol]
|
||||
format='[\[$symbol $output\]]($style) '
|
||||
command = "echo $DOCKER_HOST"
|
||||
symbol=' '
|
||||
style="bold red"
|
||||
when = '[ "$DOCKER_HOST" != "" ]'
|
||||
|
||||
[directory]
|
||||
truncation_length = 0
|
||||
format = '[$path]($style)[$read_only]($read_only_style)\] '
|
||||
|
||||
[docker_context]
|
||||
symbol = ' '
|
||||
format = '[\[$symbol$context\]]($style) '
|
||||
style = 'bold red'
|
||||
|
||||
[git_branch]
|
||||
format = '[\[$symbol$branch\]]($style) '
|
||||
symbol = ' '
|
||||
|
||||
[golang]
|
||||
format = '[$symbol]($style)'
|
||||
format = '[\[$symbol$version\]]($style) '
|
||||
|
||||
[hostname]
|
||||
format = '[@$hostname$ssh_symbol:]($style)'
|
||||
|
@ -46,9 +35,6 @@ ssh_only = false
|
|||
[package]
|
||||
disabled = true
|
||||
|
||||
[ruby]
|
||||
format = '[$symbol]($style)'
|
||||
|
||||
[username]
|
||||
format = '\[[$user]($style)'
|
||||
style_user = 'yellow'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue