GopherCon is in full swing. Go and the new world of infrastructure are deeply connected. Companies like Docker reflect that connection and show why Go has become a favorite among the “plumbers” of the container ecosystem.
The Go programming language and Docker are open source projects that have a deep connection. Docker is written in Go. It’s speed of execution and development, strong standard library, full development environment, and much more, have been critical to the development and growth of the Docker technology.
Getting Set Up
Like all open source projects, you need to set up and learn to use the right tools before you can contribute. In Docker’s case, the prerequisites are Git, Github and Docker itself. If you don’t have a free Github account, go sign up for one and then continue with this guide. If you are new to open source, I’ve found GitHub’s Guide to Contributing to Open Source to be a valuable resource.
Since Docker uses Docker to create Docker, installing Docker is naturally the first step you’ll take before contributing. The Docker installation documentation is an excellent guide for setting up Docker on OS X, Windows and Linux.
The next step is to grab the Docker contribution container. This is a special container that the Docker team uses to develop Docker. It contains all of the dependencies and tools, including the Go compiler, that you’ll need to contribute.
At this point you should have covered all of your dependencies and are ready to go on to the next step. (That’s right, you don’t need a working Go installation to contribute.)
Finding Something to Work On
Your next task is to find something to contribute. This can be one of the hardest steps in any open source project, and is especially difficult if you happen to be a brand new contributor. One of the strengths of the Docker project on GitHub is our issue organization. We use a series of labels to give contributors a sense of the type (“kind”) and difficulty (“exp”) level of any given issue, which makes it relatively easy for those new to the project to find tasks good for beginners.
Take a look at the issue log on GitHub for tasks labeled with exp/beginner or exp/novice. You can further filter this list by what kind of issue it is to find one that’s in your area of expertise. If writing is more your strength, for example, then you can look for issues that have the “kind/writing” label.
While finding an existing ticket is always a good approach, some people prefer to create a ticket for an issue or feature that they want to work on and fulfill a need they already have. If you go that route, remember to follow Docker’s contributor guidelines to give your work the best possible chance of being merged.
It’s also important to recognize that code isn’t the only way to contribute to Docker, or any open source project for that matter. You can write documentation, report an issue, add to discussions in our community, write a blog post, or take a usability test. You can even propose your own type of contribution! During a recent Docker open-source-a-thon, where core team members taught and mentored people interested in contributing to the project, we were impressed with the creativity of contributors, who did everything from writing tutorials to recording screencasts.
Leveling Up Your Go Skills (Get Going with Go)
The Docker codebase is developed in Go, so you should become familiar with the language to contribute code to the project. Fortunately, if you already have programming experience, you’ll find go a very approachable language. There are some unique features (multiple return values and channels come to mind), but overall the language reads and writes in a very straightforward way and is very quick to compile.
There are a lot of resources available for learning Go today. The official Go website has some good resources for beginners, including the Go Tour, an interactive tutorial, and Effective Go, the Go Documentation from the Go team. In my own learning of Go, I’ve found GoingGo.net to be a fantastic resource with links to many of the other resources from the community. Finally, my own blog “Hacking Management” has a lot of Go-related resources, including the very popular Getting Started With Go workshop.
One of the best ways to learn Go and become more familiar with the Docker codebase is to try to add inline documentation to a file. This provides three significant benefits:
- It will greatly help other developers who come after you to better understand the codebase.
- It will give you an opportunity to complete the contribution workflow.
- It will do this with a contribution that is certain to not break anything.
The Final Mile
Once your contribution is ready, you should commit it to your local fork and send a pull request (PR) to the Docker project. The maintainers and other members of the project will then review the PR and provide feedback. Please don’t be offended if the contribution is sent back because it needs more work. I think this is actually one of the greatest parts of the open source process. It’s precisely through this process that we receive valuable feedback and learn how to write better code.
I often hear people express that they felt uncomfortable contributing with open source because they felt that either they aren’t good enough developers, or that their contributions weren’t welcome. While I can’t speak for all projects, Docker has put in a considerable amount of effort to overcome these stigmas and to welcome contributors of any level.
If you have any questions about getting things set up, or if you’re not sure about how to address a problem with the code or documentation, we’re here to help. For people newer to open source, the gitter chatroom is easily accessible through a web browser and provides an easy authentication with GitHub.
If you’re working on a project issue, you can ask for help in GitHub simply by adding a comment containing
+status/docs-help on the issue. This creates a label that others can filter on.
If you’re familiar with IRC, feel free to drop in on the #docker or #docker-dev channel on Freenode. There are almost always Docker maintainers or community veterans around to give you a hand.
Steve Francia is Chief Operator of the Docker Project. Docker is a sponsor of The New Stack.