{"id":13459109,"url":"https://github.com/play-with-docker/play-with-docker","last_synced_at":"2025-05-13T22:04:43.396Z","repository":{"id":37546265,"uuid":"70293687","full_name":"play-with-docker/play-with-docker","owner":"play-with-docker","description":"You know it, you use it, now it's time to improve it. PWD!.","archived":false,"fork":false,"pushed_at":"2025-01-27T19:01:30.000Z","size":3337,"stargazers_count":3062,"open_issues_count":102,"forks_count":738,"subscribers_count":91,"default_branch":"master","last_synced_at":"2025-04-29T13:55:48.368Z","etag":null,"topics":["docker","playground","pwd","swarm-mode"],"latest_commit_sha":null,"homepage":"http://play-with-docker.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/play-with-docker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-08T01:10:47.000Z","updated_at":"2025-04-26T15:05:48.000Z","dependencies_parsed_at":"2023-07-13T11:18:24.741Z","dependency_job_id":"e4ca6ca7-a324-4cd9-96e8-6cc41c459811","html_url":"https://github.com/play-with-docker/play-with-docker","commit_stats":{"total_commits":655,"total_committers":34,"mean_commits":"19.264705882352942","dds":"0.40305343511450387","last_synced_commit":"4e69f4b776bd82d139511e5f3ef5dd2e79be8ab6"},"previous_names":["franela/play-with-docker"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/play-with-docker%2Fplay-with-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/play-with-docker%2Fplay-with-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/play-with-docker%2Fplay-with-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/play-with-docker%2Fplay-with-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/play-with-docker","download_url":"https://codeload.github.com/play-with-docker/play-with-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036816,"owners_count":22003653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","playground","pwd","swarm-mode"],"created_at":"2024-07-31T09:01:04.501Z","updated_at":"2025-05-13T22:04:43.350Z","avatar_url":"https://github.com/play-with-docker.png","language":"JavaScript","readme":"# play-with-docker\n\nPlay With Docker gives you the experience of having a free Alpine Linux Virtual Machine in the cloud\nwhere you can build and run Docker containers and even create clusters with Docker features like Swarm Mode.\n\nUnder the hood DIND or Docker-in-Docker is used to give the effect of multiple VMs/PCs.\n\nA live version is available at: http://play-with-docker.com/\n\n### Requirements\n\n* [Docker `18.06.0+`](https://docs.docker.com/install/)\n* [Go](https://golang.org/dl/) (stable release)\n\n### Development\n\n```bash\n# Clone this repo locally\ngit clone https://github.com/play-with-docker/play-with-docker\ncd play-with-docker\n\n# Verify the Docker daemon is running\ndocker run hello-world\n\n# Load the IPVS kernel module. Because swarms are created in dind,\n# the daemon won't load it automatically\nsudo modprobe xt_ipvs\n\n# Ensure the Docker daemon is running in swarm mode\ndocker swarm init\n\n# Get the latest franela/dind image\ndocker pull franela/dind\n\n# Optional (with go1.14): pre-fetch module requirements into vendor\n# so that no network requests are required within the containers.\n# The module cache is retained in the pwd and l2 containers so the\n# download is a one-off if you omit this step.\ngo mod vendor\n\n# Start PWD as a container\ndocker-compose up\n```\n\nNow navigate to [http://localhost](http://localhost) and click the green \"Start\" button\nto create a new session, followed by \"ADD NEW INSTANCE\" to launch a new terminal instance.\n\nNotes:\n\n* There is a hard-coded limit of 5 Docker playgrounds per session. After 4 hours sessions are deleted.\n* If you want to override the DIND version or image then set the environmental variable i.e.\n  `DIND_IMAGE=franela/docker\u003cversion\u003e-rc:dind`. Take into account that you can't use standard `dind` images, only [franela](https://hub.docker.com/r/franela/) ones work.\n\n### Port forwarding\n\nIn 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.\n\nYou can achieve this by setting up a `dnsmasq` server (you can run it in a docker container also) and adding the following configuration:\n\n```\naddress=/localhost/127.0.0.1\n```\n\nDon't forget to change your computer's default DNS to use the dnsmasq server to resolve.\n\n## FAQ\n\n### How can I connect to a published port from the outside world?\n\n\nIf you need to access your services from outside, use the following URL pattern `http://ip\u003chyphen-ip\u003e-\u003csession_jd\u003e-\u003cport\u003e.direct.labs.play-with-docker.com` (i.e: http://ip2-135-3-b8ir6vbg5vr00095iil0-8080.direct.labs.play-with-docker.com).\n\n### Why is PWD running in ports 80 and 443? Can I change that?\n\nNo, it needs to run on those ports for DNS resolve to work. Ideas or suggestions about how to improve this\nare welcome\n\n## Hints\n\n### How can I use Copy / Paste shortcuts?\n\nCtrl  + insert  : Copy\u003cbr\u003e\nshift + insert  : Paste\n","funding_links":[],"categories":["JavaScript","swarm-mode","HarmonyOS","语言资源库","docker"],"sub_categories":["Windows Manager","go"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplay-with-docker%2Fplay-with-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplay-with-docker%2Fplay-with-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplay-with-docker%2Fplay-with-docker/lists"}