Git Product home page Git Product logo

docker-machine-driver-pwd'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

Development

# Clone this repo locally
git clone https://github.com/play-with-docker/play-with-docker
cd play-with-docker

# Verify the Docker daemon is running
docker run hello-world

# Load the IPVS kernel module. Because swarms are created in dind,
# the daemon won't load it automatically
sudo modprobe xt_ipvs

# Ensure the Docker daemon is running in swarm mode
docker swarm init

# Get the latest franela/dind image
docker pull franela/dind

# Optional (with go1.14): pre-fetch module requirements into vendor
# so that no network requests are required within the containers.
# The module cache is retained in the pwd and l2 containers so the
# download is a one-off if you omit this step.
go mod vendor

# Start PWD as a container
docker-compose up

Now navigate to http://localhost and click the green "Start" button to create a new session, followed by "ADD NEW INSTANCE" to launch a new terminal instance.

Notes:

  • There is a hard-coded limit of 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.

Port forwarding

In order for port forwarding to work correctly in development you need to make *.localhost to resolve to 127.0.0.1. That way when you try to access pwd10-0-0-1-8080.host1.localhost, then you're forwarded correctly to your local PWD server.

You can achieve this by setting up a dnsmasq server (you can run it in a docker container also) and adding the following configuration:

address=/localhost/127.0.0.1

Don't forget to change your computer's default DNS to use the dnsmasq server to resolve.

FAQ

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

If you need to access your services from outside, use the following URL pattern http://ip<hyphen-ip>-<session_jd>-<port>.direct.labs.play-with-docker.com (i.e: http://ip2-135-3-b8ir6vbg5vr00095iil0-8080.direct.labs.play-with-docker.com).

Why is PWD running in ports 80 and 443? Can I change that?

No, it needs to run on those ports for DNS resolve to work. Ideas or suggestions about how to improve this are welcome

Hints

How can I use Copy / Paste shortcuts?

Ctrl + insert : Copy
shift + insert : Paste

docker-machine-driver-pwd's People

Contributors

marcosnils avatar xetorthio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-machine-driver-pwd's Issues

Created docker-machine but fails with 'Could not create instance <nil> '

In a session on http://play-with-docker.com/:

I set PWD_SESSION_ID

$ export PWD_SESSION_ID=play

Then created a docker-machine (using 386 driver, see issue #1 ).

$ docker-machine create -d pwd node1
Running pre-create checks...
Creating machine...
Error creating machine: Error in driver during machine creation: Could not create instance <nil> &{500 Internal Server Error 500 HTTP/1.1 1 1 map[Date:[Mon,
 09 Jan 2017 17:03:52 GMT] Content-Type:[text/plain; charset=utf-8]] 0x1898a090 -1 [chunked] false map[] 0x188debd0 <nil>}
The default lines below are for a sh/bash shell, you can specify the shell you're using, with the --shell flag.

Subsequent docker-machine ls shows machine was created but not completely ...

$ docker-machine ls
NAME    ACTIVE   DRIVER   STATE     URL   SWARM   DOCKER    ERRORS
node1   *        pwd      Running                 Unknown

How to use this without installing docker in system

I am a great fan of PWD and have been using it for a long time. I believe the whole point of this project is to make it easy to provision , use and manage PWD nodes from our personal systems.

Then why do I need to install docker in my system. Is there a way I can provision a new PWD node and have SSH access to it without having docker installed in my local (As I am using a educational system with limited privilege to add software)?

Thanks in Advance.

Could not create instance <nil> &{409 Conflict 409 HTTP/1.1 1 1

Hello,
I've just downloaded the latest release of docker-machine-driver-pwd (v0.0.5) and installed it on my mac :

cp ~/Downloads/docker-machine-driver/darwin/amd64/docker-machine-driver-pwd /usr/local/bin/ 

Then, I went to http://play-with-docker.com and I set up my PWD_URL env variable accordingly :

export PWD_URL="http://host4.labs.play-with-docker.com/p/90ea5123-a016-46a5-a766-787b8f83fcf3"

and finally I tried to create a docker-machine instance :

$ docker-machine create -d pwd manager1
Running pre-create checks...
Creating machine...
Error creating machine: Error in driver during machine creation: Could not create instance <nil> &{409 Conflict 409 HTTP/1.1 1 1 map[Date:[Wed, 18 Oct 2017 03:17:01 GMT] Content-Length:[0] Content-Type:[text/plain; charset=utf-8]] {} 0 [] false false map[] 0xc420110800 <nil>}

I also tried with --pwd-url, but got the exact same failure...

Unable to create machines since authentication update

Error message:

[~] user:$ export PWD_URL= `URL after auth`
[~] user:$ docker-machine create -d pwd  pwd1
Running pre-create checks...
Creating machine...
Error creating machine: Error in driver during machine creation: Could not create instance <nil> &{404 Not Found 404 HTTP/1.1 1 1 map[X-Content-Type-Options:[nosniff] Date:[Fri, 10 Nov 2017 00:04:39 GMT] Content-Length:[19] Content-Type:[text/plain; charset=utf-8]] 0xc420108980 19 [] false false map[] 0xc42000b500 <nil>}

Release extension inconsistent with actual format

Your releases are tagged .tgz which should be short for .tar.gz, which means you should be able to run the following command successfuly, instead I get this error

$ tar xzvf docker-machine-driver.tgz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

It appears that they are regular tar files, as removing the flag for gzip compression succeeds

$ tar xvf docker-machine-driver.tgz
./
./linux/
./linux/amd64/
./linux/amd64/docker-machine-driver-pwd
./linux/arm/
./linux/arm/docker-machine-driver-pwd
./linux/386/
./linux/386/docker-machine-driver-pwd
./darwin/
./darwin/amd64/
./darwin/amd64/docker-machine-driver-pwd
./darwin/386/
./darwin/386/docker-machine-driver-pwd
./windows/
./windows/amd64/
./windows/amd64/docker-machine-driver-pwd.exe
./windows/386/
./windows/386/docker-machine-driver-pwd.exe

You should either rename the extension to .tar, or compress the archive using gzip compression.

uname says x86_64, had to use 386 driver

uname -a gives

Linux node1 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 Linux

But I couldn't use the x86_64 driver, it complained

Error starting plugin binary: fork/exec /usr/local/bin/docker-machine-driver-pwd: no such file or directory

So I tried copying
linux/386/docker-machine-driver-pwd to /usr/local/bin

and now docker-machine create worked (well it got farther, it created a machine)

Error configuring PWD certs

OS: Mac OS Sierra Version 10.12.5 (16F73)
DM: docker-machine version 0.12.0, build 45c69ad

KonstaninossMBP:~ kosta$ docker-machine create -d pwd node1
Creating CA: /Users/kosta/.docker/machine/certs/ca.pem
Creating client certificate: /Users/kosta/.docker/machine/certs/cert.pem
Running pre-create checks...
Creating machine...
Error creating machine: Error in driver during machine creation: Error configuring PWD certs: Error setting up keys on PWD server 

KonstaninossMBP:386 kosta$ docker-machine ls
NAME    ACTIVE   DRIVER   STATE     URL   SWARM   DOCKER    ERRORS
node1   *        pwd      Running                 Unknown   

KonstaninossMBP:386 kosta$ docker-machine env node1
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "": dial tcp: missing address
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

KonstaninossMBP:386 kosta$ docker-machine regenerate-certs node1
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...
Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded

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.