mirror of
https://github.com/rancher/os.git
synced 2025-09-03 07:44:21 +00:00
Make it easier to switch between Docker engines
This commit is contained in:
@@ -22,6 +22,10 @@ const (
|
||||
startScript = "/opt/rancher/bin/start.sh"
|
||||
)
|
||||
|
||||
type symlink struct {
|
||||
oldname, newname string
|
||||
}
|
||||
|
||||
func Main() {
|
||||
cfg := config.LoadConfig()
|
||||
|
||||
@@ -88,6 +92,20 @@ func Main() {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
for _, link := range []symlink{
|
||||
{"/var/lib/rancher/engine/docker", "/usr/bin/docker"},
|
||||
{"/var/lib/rancher/engine/docker-containerd", "/usr/bin/docker-containerd"},
|
||||
{"/var/lib/rancher/engine/docker-containerd-ctr", "/usr/bin/docker-containerd-ctr"},
|
||||
{"/var/lib/rancher/engine/docker-containerd-shim", "/usr/bin/docker-containerd-shim"},
|
||||
{"/var/lib/rancher/engine/dockerd", "/usr/bin/dockerd"},
|
||||
{"/var/lib/rancher/engine/docker-runc", "/usr/bin/docker-runc"},
|
||||
} {
|
||||
syscall.Unlink(link.newname)
|
||||
if err = os.Symlink(link.oldname, link.newname); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
cmd = exec.Command("bash", "-c", `echo 'RancherOS \n \l' > /etc/issue`)
|
||||
if err = cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
|
Reference in New Issue
Block a user