Skip to content

Instantly share code, notes, and snippets.

@derFunk
Forked from lalyos/generate-compose.sh
Last active December 27, 2017 10:48
Show Gist options
  • Save derFunk/7a58fe9d538035f94d6cb6826e8b25e1 to your computer and use it in GitHub Desktop.
Save derFunk/7a58fe9d538035f94d6cb6826e8b25e1 to your computer and use it in GitHub Desktop.

Revisions

  1. derFunk revised this gist Sep 29, 2017. 1 changed file with 11 additions and 6 deletions.
    17 changes: 11 additions & 6 deletions generate-compose.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,14 @@
    docker-yml() {
    docker inspect -f $'
    {{.Name}}
    image: {{.Config.Image}}
    entrypoint: {{json .Config.Entrypoint}}
    environment: {{range .Config.Env}}
    - {{.}}{{end}}
    ' $1
    version: '2.2'
    services:
    {{.Name}}
    image: {{.Config.Image}}
    entrypoint: {{json .Config.Entrypoint}}
    command: {{json .Config.Cmd}}
    environment: {{range .Config.Env}}
    - {{.}}{{end}}
    volumes: {{range .Mounts}}
    - {{.Name}}:{{.Destination}}{{end}}
    ' $1
    }
  2. @lalyos lalyos created this gist Apr 5, 2015.
    9 changes: 9 additions & 0 deletions generate-compose.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    docker-yml() {
    docker inspect -f $'
    {{.Name}}
    image: {{.Config.Image}}
    entrypoint: {{json .Config.Entrypoint}}
    environment: {{range .Config.Env}}
    - {{.}}{{end}}
    ' $1
    }