Improve error handling and reporting for server installation & process boot
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
"emperror.dev/errors"
|
||||
"github.com/apex/log"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
@@ -23,7 +24,7 @@ func Docker() (*client.Client, error) {
|
||||
_conce.Do(func() {
|
||||
_client, err = client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
||||
})
|
||||
return _client, err
|
||||
return _client, errors.Wrap(err, "environment/docker: could not create client")
|
||||
}
|
||||
|
||||
// ConfigureDocker configures the required network for the docker environment.
|
||||
|
||||
@@ -54,9 +54,10 @@ type Environment struct {
|
||||
st *system.AtomicString
|
||||
}
|
||||
|
||||
// Creates a new base Docker environment. The ID passed through will be the ID that is used to
|
||||
// reference the container from here on out. This should be unique per-server (we use the UUID
|
||||
// by default). The container does not need to exist at this point.
|
||||
// New creates a new base Docker environment. The ID passed through will be the
|
||||
// ID that is used to reference the container from here on out. This should be
|
||||
// unique per-server (we use the UUID by default). The container does not need
|
||||
// to exist at this point.
|
||||
func New(id string, m *Metadata, c *environment.Configuration) (*Environment, error) {
|
||||
cli, err := environment.Docker()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user