Sha256: 873b01ccd1da7848626b82d2605fe980149f08bbf9dfc492ec942358034e9bba
Contents?: true
Size: 696 Bytes
Versions: 21
Compression:
Stored size: 696 Bytes
Contents
namespace :docker do task :build do Dir.chdir File.expand_path('../..', __FILE__) do system "docker build -f docker/Dockerfile -t rubydata/pycall ." end end desc 'Run docker container [port=8888] [attach_local=$(pwd)]' task :run do require 'securerandom' require 'launchy' token = SecureRandom.hex(48) port = ENV['port'] || '8888' attach_local = File.expand_path(ENV['attach_local'] || Dir.pwd) Thread.start do sleep 3 Launchy.open("http://localhost:#{port}/?token=#{token}") end system "docker run -it -e 'JUPYTER_TOKEN=#{token}' -v #{attach_local}:/notebooks/local -p #{port}:8888 --rm --name pycall rubydata/pycall" end end
Version data entries
21 entries across 21 versions & 1 rubygems