diff --git a/localnet/testgo/app.go b/localnet/testgo/app.go index f88ab1a..0be4e6b 100644 --- a/localnet/testgo/app.go +++ b/localnet/testgo/app.go @@ -6,7 +6,6 @@ import ( "github.com/sei-protocol/build/pkg/localnet" "github.com/sei-protocol/build/pkg/localnet/infra" "github.com/sei-protocol/build/pkg/tools" - "github.com/sei-protocol/build/pkg/tools/docker" ) // Config stores go app config. @@ -21,7 +20,6 @@ func New(config Config) *infra.App { return &infra.App{ RunAsUser: true, Name: config.Name, - Image: "alpine:" + docker.AlpineVersion, Volumes: []infra.Volume{ binVolume, }, diff --git a/localnet/testrust/app.go b/localnet/testrust/app.go index d23f62c..b9129c7 100644 --- a/localnet/testrust/app.go +++ b/localnet/testrust/app.go @@ -6,7 +6,6 @@ import ( "github.com/sei-protocol/build/pkg/localnet" "github.com/sei-protocol/build/pkg/localnet/infra" "github.com/sei-protocol/build/pkg/tools" - "github.com/sei-protocol/build/pkg/tools/docker" ) // Config stores rust app config. @@ -21,7 +20,6 @@ func New(config Config) *infra.App { return &infra.App{ RunAsUser: true, Name: config.Name, - Image: "alpine:" + docker.AlpineVersion, Volumes: []infra.Volume{ binVolume, }, diff --git a/pkg/localnet/infra/docker.go b/pkg/localnet/infra/docker.go index f8f5497..0f1965e 100644 --- a/pkg/localnet/infra/docker.go +++ b/pkg/localnet/infra/docker.go @@ -196,7 +196,12 @@ func (d *Docker) prepareRunArgs(app *App) []string { runArgs = append(runArgs, "--entrypoint", app.Entrypoint) } - runArgs = append(runArgs, app.Image) + image := app.Image + if image == "" { + image = AlpineImage() + } + + runArgs = append(runArgs, image) if app.ArgsFunc != nil { runArgs = append(runArgs, app.ArgsFunc()...) } diff --git a/pkg/localnet/infra/helpers.go b/pkg/localnet/infra/helpers.go index 70ce55e..8b2a8f6 100644 --- a/pkg/localnet/infra/helpers.go +++ b/pkg/localnet/infra/helpers.go @@ -13,8 +13,14 @@ import ( "go.uber.org/zap" "github.com/sei-protocol/build/pkg/retry" + "github.com/sei-protocol/build/pkg/tools/docker" ) +// AlpineImage returns the default docker image used to run containers. +func AlpineImage() string { + return "alpine:" + docker.AlpineVersion +} + // WaitUntilHealthy waits until app is healthy or context expires. func WaitUntilHealthy(ctx context.Context, hFuncs map[string]func(ctx context.Context) error) error { log := logger.Get(ctx) diff --git a/pkg/tools/docker/tools.go b/pkg/tools/docker/docker.go similarity index 100% rename from pkg/tools/docker/tools.go rename to pkg/tools/docker/docker.go