-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
main.go
45 lines (38 loc) · 895 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* A tool to create & restore full backups of Docker containers
* Copyright (c) 2019, Christian Muehlhaeuser <[email protected]>
*
* For license see LICENSE
*/
package main
import (
"context"
"fmt"
"os"
"github.com/docker/docker/client"
"github.com/spf13/cobra"
)
var (
cli *client.Client
ctx = context.Background()
// RootCmd is the core command used for cli-arg parsing
RootCmd = &cobra.Command{
Use: "docker-backup",
Short: "docker-backup creates or restores backups of Docker containers",
SilenceErrors: true,
SilenceUsage: true,
}
)
func main() {
var err error
// cli, err = client.NewEnvClient()
// cli, err = client.NewClientWithOpts(client.FromEnv)
cli, err = client.NewClientWithOpts(client.WithVersion("1.36"))
if err != nil {
panic(err)
}
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(-1)
}
}