mirror of
https://github.com/rancher/os.git
synced 2025-09-20 01:54:53 +00:00
- Use burmilla GitHub repos - Release under burmilla Docker Hub - GitHub action for create releases - Updated boot image and login banner - Use Debian as default console - Updated system-cron to v0.5.0 - Updated services to latest versions - Bump up kernel to 4.14.206 - Include burmilla/os-debianconsole:v1.9.0 to initrd
36 lines
974 B
Go
36 lines
974 B
Go
package docker
|
|
|
|
import (
|
|
"github.com/burmilla/os/pkg/util"
|
|
|
|
composeConfig "github.com/docker/libcompose/config"
|
|
"github.com/docker/libcompose/docker"
|
|
"github.com/docker/libcompose/project"
|
|
)
|
|
|
|
type ServiceFactory struct {
|
|
Context *docker.Context
|
|
Deps map[string][]string
|
|
}
|
|
|
|
func (s *ServiceFactory) Create(project *project.Project, name string, serviceConfig *composeConfig.ServiceConfig) (project.Service, error) {
|
|
if after := serviceConfig.Labels["io.rancher.os.after"]; after != "" {
|
|
for _, dep := range util.TrimSplit(after, ",") {
|
|
if dep == "cloud-init" {
|
|
dep = "cloud-init-execute"
|
|
}
|
|
s.Deps[name] = append(s.Deps[name], dep)
|
|
}
|
|
}
|
|
if before := serviceConfig.Labels["io.rancher.os.before"]; before != "" {
|
|
for _, dep := range util.TrimSplit(before, ",") {
|
|
if dep == "cloud-init" {
|
|
dep = "cloud-init-execute"
|
|
}
|
|
s.Deps[dep] = append(s.Deps[dep], name)
|
|
}
|
|
}
|
|
|
|
return NewService(s, name, serviceConfig, s.Context, project), nil
|
|
}
|