Developer Tools68k+ stars

Docker

Container platform that changed deployment forever

Commit Details

Message
"Initial commit"
Author
Solomon Hykes
Date
2013-01-18
Hash
a27b4b8cb8e838d03a99b6d2b30f76bdaf2f9e5d

Fun Fact

Docker was originally part of dotCloud, a PaaS company. It was open-sourced after Solomon Hykes realized the container tech was more valuable than the platform.

</>First Code

Go
package main

import (
	"flag"
	"fmt"
	"github.com/dotcloud/docker"
	"log"
)

func main() {
	docker.SysInit()
	
	if docker.SelfPath() == "/sbin/init" {
		// Running as init inside container
		docker.DockerInit()
	}
	
	// Parse command line
	host := flag.String("H", "127.0.0.1", "Host to connect to")
	port := flag.Int("p", 4242, "Port")
	flag.Parse()
	
	docker := New(*host, *port)
	docker.CmdRun(flag.Args())
}