npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

torrent-docker

v1.6.0

Published

MAD SCIENCE realtime boot of remote docker images using bittorrent

Downloads

18

Readme

torrent-docker

MAD SCIENCE realtime boot of remote docker images using bittorrent

npm install -g torrent-docker
torrent-docker --help

HOLD ON TO YOUR BRAIN

Docker images are HUGE. A simple hello world node app easily takes up > 600MB space. Downloading/uploading these images can a looong time.

To fix this torrent-docker implements a union file system that allows you to mount a docker image shared using bittorrent and boot a container - all in realtime!

whoa

Usage

Seed a docker image

First create a docker image

FROM ubuntu:14.04
RUN apt-get update && apt-get install -qy curl vim

Then build it

docker build -t test-image .

Now all we need to do is create a torrent from the docker image

torrent-docker create test-image

This creates a file test-image.torrent and a data folder test-image/. Share this torrent using your favorite torrent client or do

torrent-docker seed test-image.torrent # will print a activity log

Realtime boot the docker image

Now copy test-image.torrent to another machine. To boot the image do

torrent-docker boot test-image.torrent my-container

This will mount the torrent as a union file system (that is writable!) and boot the docker image. In addition it will also seed the torrent which means the more containers you boot the more the torrent will be seeded.

You can attach to the debug log to see download speed, how many peers your are connected to, which files are being accessed etc using

nc localhost 10000 # will tail the debug log from the boot process

After a couple of seconds (depending on your internet connection, ymmw) you should be attached to a bash process running in your image! If for some reason your boot process cannot find a seeder you can specify them doing

torrent-docker boot test-image.torrent my-container --peer 128.199.33.21:6441

Optionally you can start your own tracker

torrent-docker tracker --port 8080
torrent-docker boot test-image.torrent my-container --tracker 127.0.0.1:8080

Dependencies

On OSX you'll need the following

  • boot2docker, https://github.com/boot2docker/boot2docker
  • osx fuse, http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
  • pkg-config, brew install pkg-config

To make /var, /etc belong to root you need to run the following after installing boot2docker

boot2docker ssh
sudo umount /Users
sudo mount -t vboxsf Users /Users/

You need to run this everytime you boot boot2docker

Troubleshooting

THIS IS HIGHLY EXPERIMENTAL.

Currently I have only tested this on OSX using OSX fuse and boot2docker.