Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/play-with-docker/play-with-docker
You know it, you use it, now it's time to improve it. PWD!.
https://github.com/play-with-docker/play-with-docker
docker playground pwd swarm-mode
Last synced: 4 days ago
JSON representation
You know it, you use it, now it's time to improve it. PWD!.
- Host: GitHub
- URL: https://github.com/play-with-docker/play-with-docker
- Owner: play-with-docker
- License: mit
- Created: 2016-10-08T01:10:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-20T05:05:08.000Z (about 1 month ago)
- Last Synced: 2025-01-14T19:25:25.853Z (11 days ago)
- Topics: docker, playground, pwd, swarm-mode
- Language: JavaScript
- Homepage: http://play-with-docker.com
- Size: 3.18 MB
- Stars: 3,006
- Watchers: 93
- Forks: 732
- Open Issues: 98
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
- awesome - play-with-docker/play-with-docker - You know it, you use it, now it's time to improve it. PWD!. (JavaScript)
- awesomeLibrary - play-with-docker - You know it, you use it, now it's time to improve it. PWD!. (语言资源库 / go)
- awesome - play-with-docker/play-with-docker - You know it, you use it, now it's time to improve it. PWD!. (JavaScript)
- awesome-list - play-with-docker - with-docker | 2018 | (JavaScript)
- awesome-list-docker - play-with-docker
README
# 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 `18.06.0+`](https://docs.docker.com/install/)
* [Go](https://golang.org/dl/) (stable release)### Development
```bash
# 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](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-rc:dind`. Take into account that you can't use standard `dind` images, only [franela](https://hub.docker.com/r/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--.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