Fix of missing docker sock config in the container instance
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adam Štrauch 2022-02-06 02:02:30 +01:00
parent c8a93d7993
commit 722d2a1c86
Signed by: cx
GPG Key ID: 018304FFA8988F8D

View File

@ -132,6 +132,10 @@ func (p *Processor) Get() (apps.App, error) {
// Gather runtime info about the container // Gather runtime info about the container
container := docker.Container{ container := docker.Container{
App: &app, App: &app,
DockerSock: p.DockerSock,
BindIPHTTP: p.BindIPHTTP,
BindIPSSH: p.BindIPSSH,
AppsPath: p.AppsPath,
} }
status, err := container.Status() status, err := container.Status()
@ -173,6 +177,10 @@ func (p *Processor) Create(appTemplate apps.App) error {
container := docker.Container{ container := docker.Container{
App: &appTemplate, App: &appTemplate,
DockerSock: p.DockerSock,
BindIPHTTP: p.BindIPHTTP,
BindIPSSH: p.BindIPSSH,
AppsPath: p.AppsPath,
} }
err = container.Create() err = container.Create()
@ -227,6 +235,10 @@ func (p *Processor) Update(appTemplate apps.App) error {
container := docker.Container{ container := docker.Container{
App: app, App: app,
DockerSock: p.DockerSock,
BindIPHTTP: p.BindIPHTTP,
BindIPSSH: p.BindIPSSH,
AppsPath: p.AppsPath,
} }
err = container.Destroy() err = container.Destroy()
@ -256,15 +268,11 @@ func (p *Processor) Delete() error {
processor := apps.AppsProcessor{ processor := apps.AppsProcessor{
DB: p.DB, DB: p.DB,
} }
app, err := processor.Get(p.AppName) container, err := p.getContainer()
if err != nil { if err != nil {
log.Println("ERROR: delete app:", err.Error()) log.Println("ERROR: delete app:", err.Error())
} }
container := docker.Container{
App: &app,
}
status, err := container.Status() status, err := container.Status()
if err != nil { if err != nil {
return err return err
@ -284,7 +292,7 @@ func (p *Processor) Delete() error {
} }
} }
err = processor.Delete(app.Name) err = processor.Delete(p.AppName)
if err != nil { if err != nil {
return err return err
} }
@ -294,17 +302,7 @@ func (p *Processor) Delete() error {
// Stop stops app // Stop stops app
func (p *Processor) Stop() error { func (p *Processor) Stop() error {
processor := apps.AppsProcessor{ container, err := p.getContainer()
DB: p.DB,
}
app, err := processor.Get(p.AppName)
if err != nil {
return err
}
container := docker.Container{
App: &app,
}
status, err := container.Status() status, err := container.Status()
if err != nil { if err != nil {
@ -324,18 +322,11 @@ func (p *Processor) Stop() error {
// Start starts app // Start starts app
func (p *Processor) Start() error { func (p *Processor) Start() error {
processor := apps.AppsProcessor{ container, err := p.getContainer()
DB: p.DB,
}
app, err := processor.Get(p.AppName)
if err != nil { if err != nil {
return err return err
} }
container := docker.Container{
App: &app,
}
status, err := container.Status() status, err := container.Status()
if err != nil { if err != nil {
return err return err
@ -357,18 +348,11 @@ func (p *Processor) Start() error {
// Restart restarts app // Restart restarts app
func (p *Processor) Restart() error { func (p *Processor) Restart() error {
processor := apps.AppsProcessor{ container, err := p.getContainer()
DB: p.DB,
}
app, err := processor.Get(p.AppName)
if err != nil { if err != nil {
return err return err
} }
container := docker.Container{
App: &app,
}
err = container.Restart() err = container.Restart()
if err != nil { if err != nil {
return err return err