How To Add A “Try In Play-With-Docker” Button To Your Github Project

Oren Yomtov
Oct 8, 2018 · 2 min read
“stack of cargo trailer” by Guillaume Bolduc on Unsplash

I was inspired by the great experience I had when evaluating a repository on GitHub, because it had a Play-With-Docker button that allowed me to instantly spin up all the containers necessary to run the project, and see if it fits my needs.

The button is so inviting! This is just what I’m looking for when evaluating a project

What Is PWD (Play-With-Docker)?

Brilliant GitHub project readme cover photo

PWD is a service that provides you with a temporary private Docker environment inside your browser.

For a period of 4 hours, you can pull, build, run and interact with as many Docker containers as you wish.

It is one of the best projects I know that utilise Docker in Docker technology.

The project was hacked by Marcos Liljedhal and Jonathan Leibiusky and is sponsored by Docker Inc.

How Does It Look Like?

See for yourself how PWD pulls and runs 6 containers over 3 networks in 25 seconds:

Giving this level of immediacy to potential open-source project contributors can increase the rate of community involvement in any project.

How To Add The “Try in PWD” Button

It’s quite simple actually. Insert the following Markdown to your README.md file:

[![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/vegasbrianc/prometheus/version-2/pwd-stack.yml)

All you need to do is change the link in bold to a docker-compose.yml file that spins up the environment needed to test run your project.

In the docker-compose.yml file you can either reference docker images hosted on a public docker repository (e.g. Docker Hub), or a remote git repository with a Dockerfile that will be built on demand:

services:
redis-commander:
build: https://github.com/joeferner/redis-commander.git

If you used this quick how-to to add the “Try in PWD” button to a project, please let me know in the comments!


Subscribe for updates, clap for serotonin, and say hi on Twitter or the streets of Tel Aviv

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store