Skip to content

Commit

Permalink
only set command if non-nil
Browse files Browse the repository at this point in the history
  • Loading branch information
aksiksi committed Dec 2, 2023
1 parent 59430ec commit 036e251
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ func (g *Generator) buildNixContainer(service types.ServiceConfig) (*NixContaine
Volumes: make(map[string]string),
SystemdConfig: systemdConfig,
LogDriver: "journald", // This is the NixOS default
Command: service.Command,
}

if g.IncludeEnvFiles {
Expand All @@ -242,6 +241,10 @@ func (g *Generator) buildNixContainer(service types.ServiceConfig) (*NixContaine
c.Volumes[v.Source] = v.String()
}

if !service.Command.IsZero() {
c.Command = service.Command
}

// Figure out explicit dependencies for this container.
for _, s := range service.GetDependencies() {
targetContainerName, ok := g.serviceToContainerName[s]
Expand Down

0 comments on commit 036e251

Please sign in to comment.