Skip to content

Instantly share code, notes, and snippets.

@dunn
Created May 5, 2020 18:16
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 dunn/6dbd4015ee3d686c4dd8e1aa701af2d7 to your computer and use it in GitHub Desktop.
Save dunn/6dbd4015ee3d686c4dd8e1aa701af2d7 to your computer and use it in GitHub Desktop.
dork () {
rubyversion=$(cat "$(pwd)/.ruby-version" | tr -d '\n')
rubystring="ruby"
if [[ "$rubyversion" != "" ]]; then
rubystring="ruby:${rubyversion}"
fi
imagename=$(echo "${rubystring}" | sed 's|\:|_|')
docker run --name "${imagename}" -v "$(pwd)":/app -w /app "${rubystring}" /bin/bash -c "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment