Git Product home page Git Product logo

docker-machine-driver-pwd's Introduction

docker-machine-pwd-driver

Docker machine PWD driver

Getting started

This driver tricks machine and allows to create / remove play-with-docker instances remotely.

Before using it please make sure of the following:

  • Create a session in PWD and set PWD_URL env variable or use --pwd-url flag when creating an instance

Compiling from source

Use glide to install dependencies (needs to have a proper goland setup)

glide install

Compile simply with:

go build

To have a statically linked binary:

CGO_ENABLED=0 go build -a -installsuffix nocgo  .

Installing

Easy way

Download the release bundle from the releases section and place the binary that corresponds to your platform it somewhere in your PATH

Hard way

Use go get github.com/play-with-docker/docker-machine-driver-pwd and make sure that docker-machine-driver-pwd is located somewhere in your PATH

Usage

  • Creating an instance:
# Create a session in play-with-docker.com and set the PWD_URL env variable
docker-machine create -d pwd --pwd-url <pwd_url> node1
eval $(docker-machine env node1)
docker ps

Alternatively you can set the env variable PWD_URL to avoid passing it as a flag every time.

  • Remove an instance
docker-machine rm -f node1
  • Which session am I using
docker-machine inspect node1

Have a look at the "Driver" section for this information.

Development

For local development it's necessary to set PWD_PORT, PWD_HOSTNAME and PWD_SSL_PORT accordingly to use with local PWD.

i.e:

export PWD_PORT=3000
export PWD_SSL_PORT=3001

changelog

  • I changed the way pwd asks for a session. It does not need to have the playground url with a "/p/ID_OF_YOUR_PLAYGROUND" in it. If you give it a playground, it will create a sandbox in it (if it exists), or else it will create a session and sandbox in it. This parameters can be seen using the command "docker-machine inspect YOUR_MACHINE"

  • In order to achieve this, I had to modify the play-with-docker version by returning a JSON when you create a new session (instead of nothing). This json looks like below. This change can be done in the handlers/new_session.go

{"session_id":"ac95f9e1-093b-4fe8-af79-5a3180d41e89","hostname":"playground.localhost"}

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.