cidfile="$(mktemp --dry-run "/tmp/nodelist.tmp.XXXXXXXXXX")" functionon_exit() { if [ -f "${cidfile}" ]; then cid="$(cat ${cidfile})" if [ -z "${cid}" ]; then return fi docker inspect ${cid} 2>/dev/null 1>/dev/null if [ $? -eq 0 ]; then docker kill${cid} -s QUIT fi rm -f "${cidfile}" fi }
trap"on_exit" EXIT
docker run --rm -it --cidfile="${cidfile}" xxx ruby fuga.rb
Country Name (2 letter code) [AU]:JP State or Province Name (full name) [Some-State]:Tokyo Locality Name (eg, city) []:Shibuya Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany, Inc. Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:*.example.com Email Address []:admin@example.com
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: