Code Monkey home page Code Monkey logo

play-with-docker's Introduction

play-with-docker

Play With Docker gives you the experience of having a free Alpine Linux Virtual Machine in the cloud where you can build and run Docker containers and even create clusters with Docker features like Swarm Mode.

Under the hood DIND or Docker-in-Docker is used to give the effect of multiple VMs/PCs.

A live version is available at: http://play-with-docker.com/

Requirements

Docker 1.13+ is required. You can use docker-machine with the following command:

docker-machine create -d virtualbox --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.13.0-rc1/boot2docker.iso <name>

The docker daemon needs to run in swarm mode because PWD uses overlay attachable networks. For that just run docker swarm init.

It's also necessary to manually load the IPVS kernel module because as swarms are created in dind, the daemon won't load it automatically. Run the following command for that purpose: sudo modprobe xt_ipvs

If you are developing, there is a Makefile file with 2 targets that can set the whole environment for you (using docker-machine and virtual box). Just run once make create, which will create the docker-machine environment. Additionally, every time you want to start you environment run make start. And to start the application on a container on the docker machine host, run: eval $(docker-machine env pwd) && docker-compose up

Installation

Start the Docker daemon on your machine and run docker pull franela/dind.

  1. Install go 1.7.1 with brew on Mac or through a package manager.

  2. go get -v -d -t ./...

  3. Start PWD as a container with docker-compose up.

  4. Point to http://localhost:3000/ and click "New Instance"

Notes:

  • There is a hard-coded limit to 5 Docker playgrounds per session. After 4 hours sessions are deleted.
  • If you want to override the DIND version or image then set the environmental variable i.e. DIND_IMAGE=franela/docker<version>-rc:dind. Take into account that you can't use standard dind images, only franela ones work.

FAQ

How can I connect to a published port from the outside world?

We're planning to setup a reverse proxy that handles redirection automatically, in the meantime you can use ngrok within PWD running docker run --name supergrok -d jpetazzo/supergrok then docker logs --follow supergrok , it will give you a ngrok URL, now you can go to that URL and add the IP+port that you want to connect to… e.g. if your PWD instance is 10.0.42.3, you can go to http://xxxxxx.ngrok.io/10.0.42.3:8000 (where the xxxxxx is given to you in the supergrok logs).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.