Moved docker-enter function to docker plugin

Using the recommended enter approach (exec) instead of the previously
used nsenter.
pull/534/head
Nils Winkler 2015-07-16 13:24:03 +02:00
parent 6512be5222
commit 04907a7197
2 changed files with 9 additions and 5 deletions

View File

@ -7,9 +7,4 @@ if [[ `uname -s` == "Darwin" ]]; then
export DOCKER_HOST="tcp://192.168.59.103:2376" export DOCKER_HOST="tcp://192.168.59.103:2376"
export DOCKER_CERT_PATH="~/.boot2docker/certs/boot2docker-vm" export DOCKER_CERT_PATH="~/.boot2docker/certs/boot2docker-vm"
export DOCKER_TLS_VERIFY=1 export DOCKER_TLS_VERIFY=1
docker-enter() {
boot2docker ssh '[ -f /var/lib/boot2docker/nsenter ] || docker run --rm -v /var/lib/boot2docker/:/target jpetazzo/nsenter'
boot2docker ssh -t sudo "/var/lib/boot2docker/docker-enter \"$1\""
}
fi fi

View File

@ -13,6 +13,15 @@ function docker-remove-most-recent-image() {
docker images | head -2 | tail -1 | awk '{print $3}' | xargs docker rmi docker images | head -2 | tail -1 | awk '{print $3}' | xargs docker rmi
} }
function docker-enter() {
about 'enter the specified docker container using bash'
group 'docker'
param '1: Name of the container to enter'
example 'docker-enter oracle-xe'
docker exec -it "$@" /bin/bash;
}
function docker-remove-images() { function docker-remove-images() {
about 'attempt to remove images with supplied tags or all if no tags are supplied' about 'attempt to remove images with supplied tags or all if no tags are supplied'
group 'docker' group 'docker'