Skip to content

Instantly share code, notes, and snippets.

@raphink
Created March 9, 2017 13:40
Show Gist options
  • Save raphink/4dc8629da66fa5f3a05002890c45f358 to your computer and use it in GitHub Desktop.
Save raphink/4dc8629da66fa5f3a05002890c45f358 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/docker/libcompose/config"
)
func main() {
composev2 := `
version: '2'
services:
hello:
image: "tutum/hello-world"
ports:
- 9090:9090/tcp
volumes:
test:
`
if c, err := config.CreateConfig([]byte(composev2)); err != nil {
fmt.Println(err)
} else {
fmt.Printf("%+v\n", c)
}
composev1 := `
hello:
image: "tutum/hello-world"
ports:
- 9090:9090/tcp
`
if c, err := config.CreateConfig([]byte(composev1)); err != nil {
fmt.Println(err)
} else {
fmt.Printf("%+v\n", c)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment