diff --git a/README.md b/README.md index e8f97aa..85a57df 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,7 @@ Finally two other components exist: # Technical Overview The go command is almost dependency free. -It expects that a basic debian system (in particular the `apt-get` command) is available. -The command has been tested only under Debian 10, but may also work under older or newer versions. -The command expects to be run as root, and will fail when this is not the case. +It only expects that `docker` and `docker compose` are available. Each subcommand comes with documentation, which can be found in this readme (and the readme is always outdated), as well as via the command line when passing a `--help` flag. diff --git a/cmd/bootstrap.go b/cmd/bootstrap.go index 5713cfc..e4dc42d 100644 --- a/cmd/bootstrap.go +++ b/cmd/bootstrap.go @@ -193,7 +193,8 @@ func (bs cBootstrap) Run(context wisski_distillery.Context) error { // Tell the user how to proceed logging.LogMessage(context.IOStream, "Bootstrap is complete") context.Printf("Adjust the configuration file at %s\n", envPath) - context.Printf("Then grab a GraphDB zipped source file and run:\n") + context.Printf("Then make sure 'docker compose' is installed.\n") + context.Printf("Finally grab a GraphDB zipped source file and run:\n") context.Printf("%s system_update /path/to/graphdb.zip\n", wdcliPath) return nil diff --git a/cmd/system_update.go b/cmd/system_update.go index c373897..ab5ccbc 100644 --- a/cmd/system_update.go +++ b/cmd/system_update.go @@ -20,8 +20,8 @@ import ( var SystemUpdate wisski_distillery.Command = systemupdate{} type systemupdate struct { - SkipCoreUpdates bool `short:"s" long:"skip-core-updates" description:"Skip applying operating system and other core system updates"` - Positionals struct { + InstallDocker bool `short:"a" long:"install-docker" description:"Try to automatically install docker. Assumes 'apt-get' as a package manager. "` + Positionals struct { GraphdbZip string `positional-arg-name:"PATH_TO_GRAPHDB_ZIP" required:"1-1" description:"path to the graphdb.zip file"` } `positional-args:"true"` } @@ -79,7 +79,7 @@ func (si systemupdate) Run(context wisski_distillery.Context) error { } } - if !si.SkipCoreUpdates { + if si.InstallDocker { // install system updates logging.LogMessage(context.IOStream, "Updating Operating System Packages") if err := si.mustExec(context, "", "apt-get", "update"); err != nil { @@ -100,6 +100,16 @@ func (si systemupdate) Run(context wisski_distillery.Context) error { } } + logging.LogMessage(context.IOStream, "Checking that 'docker' is installed") + if err := si.mustExec(context, "", "docker", "--version", dis.Config.DockerNetworkName); err != nil { + return err + } + + logging.LogMessage(context.IOStream, "Checking that 'docker compose' is available") + if err := si.mustExec(context, "", "docker", "compose", "version"); err != nil { + return err + } + // create the docker network // TODO: Use docker API for this logging.LogMessage(context.IOStream, "Updating Docker Configuration")