mirror of
https://github.com/rancher/os.git
synced 2025-09-14 06:00:06 +00:00
v2.0.0
* Downgrade system-docker to 17.06.107 (last version before rename) * Use Docker 24.0.9 by default. 25.0.3 available as alternative. * Buildroot 2023.02.10 * Kernel 5.10.211 * Always generate dhcpd.conf (not only with Wi-Fi) * Support user Docker "data_root" configuration
This commit is contained in:
@@ -42,20 +42,20 @@ var (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Fork bool
|
||||
PidOne bool
|
||||
CommandName string
|
||||
DNSConfig netconf.DNSConfig
|
||||
BridgeName string
|
||||
BridgeAddress string
|
||||
BridgeMtu int
|
||||
CgroupHierarchy map[string]string
|
||||
LogFile string
|
||||
NoLog bool
|
||||
NoFiles uint64
|
||||
Environment []string
|
||||
GraphDirectory string
|
||||
DaemonConfig string
|
||||
Fork bool
|
||||
PidOne bool
|
||||
CommandName string
|
||||
DNSConfig netconf.DNSConfig
|
||||
BridgeName string
|
||||
BridgeAddress string
|
||||
BridgeMtu int
|
||||
CgroupHierarchy map[string]string
|
||||
LogFile string
|
||||
NoLog bool
|
||||
NoFiles uint64
|
||||
Environment []string
|
||||
DataRootDirectory string
|
||||
DaemonConfig string
|
||||
}
|
||||
|
||||
func createMounts(mounts ...[]string) error {
|
||||
@@ -400,8 +400,8 @@ func ParseConfig(config *Config, args ...string) []string {
|
||||
if err != nil {
|
||||
config.BridgeMtu = mtu
|
||||
}
|
||||
} else if strings.HasPrefix(arg, "-g") || strings.HasPrefix(arg, "--graph") {
|
||||
config.GraphDirectory = GetValue(i, args)
|
||||
} else if strings.HasPrefix(arg, "--data-root") {
|
||||
config.DataRootDirectory = GetValue(i, args)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,12 +495,12 @@ func createDaemonConfig(config *Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func cleanupFiles(graphDirectory string) {
|
||||
func cleanupFiles(dataRootDirectory string) {
|
||||
zeroFiles := []string{
|
||||
"/etc/docker/key.json",
|
||||
"/etc/docker/daemon.json",
|
||||
"/etc/docker/system-daemon.json",
|
||||
path.Join(graphDirectory, "image/overlay/repositories.json"),
|
||||
path.Join(dataRootDirectory, "image/overlay/repositories.json"),
|
||||
}
|
||||
|
||||
for _, file := range zeroFiles {
|
||||
@@ -518,13 +518,13 @@ func createLayout(config *Config) error {
|
||||
return err
|
||||
}
|
||||
|
||||
graphDirectory := config.GraphDirectory
|
||||
dataRootDirectory := config.DataRootDirectory
|
||||
|
||||
if config.GraphDirectory == "" {
|
||||
graphDirectory = "/var/lib/docker"
|
||||
if config.DataRootDirectory == "" {
|
||||
dataRootDirectory = "/var/lib/docker"
|
||||
}
|
||||
|
||||
if err := createDirs(graphDirectory); err != nil {
|
||||
if err := createDirs(dataRootDirectory); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ func createLayout(config *Config) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cleanupFiles(graphDirectory)
|
||||
cleanupFiles(dataRootDirectory)
|
||||
|
||||
symlinks := [][]string{
|
||||
{"usr/lib", "/lib"},
|
||||
|
Reference in New Issue
Block a user