Nov 30, 2018

More Docker Fun

Handy command pulled from SO to ensure when you enter a docker container, the terminal buffer size isn't 100% messed up:

https://stackoverflow.com/questions/38786615/docker-number-of-lines-in-terminal-changing-inside-docker/49281526#49281526

goinside(){
    docker exec -it $1 bash -c "stty cols $COLUMNS rows $LINES && bash";
}
_goinside(){
    COMPREPLY=( $(docker ps --format "{{.Names}}" -f name=$2) );
}
complete -F _goinside goinside;
export -f goinside;

Sep 5, 2018

Docker Thoughts

Run the following command to get the IP addresses of the host machine. You an then use the docker IP address within the container to access the host machine: ip -4 addr

Trash all unused images: docker image prune -a