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

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