Skip to content

Instantly share code, notes, and snippets.

@mcenirm
Created May 12, 2016 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcenirm/582f7c049de4e7a089e2068621dc194f to your computer and use it in GitHub Desktop.
Save mcenirm/582f7c049de4e7a089e2068621dc194f to your computer and use it in GitHub Desktop.
#!/bin/bash
name=$( basename "$0" .bash )
_stop () {
docker kill "$name"
docker rm "$name"
}
_e () {
docker exec "$name" "$@"
}
_stop
set -e
set -x
docker run --rm --name "$name" -e http_proxy=http://192.168.99.1:3128 centos:7.2.1511 sleep 300 &
sleep 1
_e yum -y install /usr/sbin/ip
_e /usr/sbin/ip addr show
_stop
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment