sábado, 22 de junio de 2019

Instalar Docker-machine


Instalación de docker-machine

bext@bext-VPCF13WFX:~$ base=https://github.com/docker/machine/releases/download/v0.16.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && sudo install /tmp/docker-machine /usr/local/bin/docker-machine
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   617    0   617    0     0   1359      0 --:--:-- --:--:-- --:--:--  1356
100 26.8M  100 26.8M    0     0  2397k      0  0:00:11  0:00:11 --:--:-- 3404k
[sudo] password for bext: 

Verificamos la version de docker-machine
bext@bext-VPCF13WFX:~$ docker-machine version
docker-machine version 0.16.0, build 702c267f

Complementamos la instalación en el bash

bext@bext-VPCF13WFX:~$ base=https://raw.githubusercontent.com/docker/machine/v0.16.0
bext@bext-VPCF13WFX:~$ for i in docker-machine-prompt.bash docker-machine-wrapper.bash docker-machine.bash; do   sudo wget "$base/contrib/completion/bash/${i}" -P /etc/bash_completion.d; done
--2019-06-21 21:52:23--  https://raw.githubusercontent.com/docker/machine/v0.16.0/contrib/completion/bash/docker-machine-prompt.bash
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.48.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.48.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1469 (1.4K) [text/plain]
Saving to: ‘/etc/bash_completion.d/docker-machine-prompt.bash’

docker-machine-prompt.bash            100%[=======================================================================>]   1.43K  --.-KB/s    in 0s      

2019-06-21 21:52:24 (101 MB/s) - ‘/etc/bash_completion.d/docker-machine-prompt.bash’ saved [1469/1469]

--2019-06-21 21:52:24--  https://raw.githubusercontent.com/docker/machine/v0.16.0/contrib/completion/bash/docker-machine-wrapper.bash
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.48.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.48.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1525 (1.5K) [text/plain]
Saving to: ‘/etc/bash_completion.d/docker-machine-wrapper.bash’

docker-machine-wrapper.bash           100%[=======================================================================>]   1.49K  --.-KB/s    in 0s      

2019-06-21 21:52:24 (95.6 MB/s) - ‘/etc/bash_completion.d/docker-machine-wrapper.bash’ saved [1525/1525]

--2019-06-21 21:52:24--  https://raw.githubusercontent.com/docker/machine/v0.16.0/contrib/completion/bash/docker-machine.bash
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.48.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.48.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12211 (12K) [text/plain]
Saving to: ‘/etc/bash_completion.d/docker-machine.bash’

docker-machine.bash                   100%[=======================================================================>]  11.92K  --.-KB/s    in 0.002s  

2019-06-21 21:52:24 (4.79 MB/s) - ‘/etc/bash_completion.d/docker-machine.bash’ saved [12211/12211]

bext@bext-VPCF13WFX:~$ 

Tomamos los cambios del bash
bext@bext-VPCF13WFX:~$ source /etc/bash_completion.d/docker-machine-prompt.bash

Queda actualizar el prompt el cual indicará la docker-machine, se editara en el .bashrc modificando la variable PS1 agregando $(__docker_machine_ps1) como acomode a nuestro gusto

ejemplo PS1='[\u@\h \W$(__docker_machine_ps1)]\$ '

Este es el .bashrc original
...
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\$
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac
...


eot

No hay comentarios:

Publicar un comentario