@@ -92,6 +92,13 @@ func (p *BuildrootProvisioner) GenerateDockerOptions(dockerPort int) (*provision
92
92
driverNameLabel := fmt .Sprintf ("provider=%s" , p .Driver .DriverName ())
93
93
p .EngineOptions .Labels = append (p .EngineOptions .Labels , driverNameLabel )
94
94
95
+ noPivot := true
96
+ // Using pivot_root is not supported on fstype rootfs
97
+ if fstype , err := rootFileSystemType (p ); err == nil {
98
+ log .Debugf ("root file system type: %s" , fstype )
99
+ noPivot = fstype == "rootfs"
100
+ }
101
+
95
102
engineConfigTmpl := `[Unit]
96
103
Description=Docker Application Container Engine
97
104
Documentation=https://docs.docker.com
@@ -101,8 +108,14 @@ Requires= minikube-automount.service docker.socket
101
108
[Service]
102
109
Type=notify
103
110
111
+ `
112
+ if noPivot {
113
+ engineConfigTmpl += `
104
114
# DOCKER_RAMDISK disables pivot_root in Docker, using MS_MOVE instead.
105
115
Environment=DOCKER_RAMDISK=yes
116
+ `
117
+ }
118
+ engineConfigTmpl += `
106
119
{{range .EngineOptions.Env}}Environment={{.}}
107
120
{{end}}
108
121
@@ -160,6 +173,14 @@ WantedBy=multi-user.target
160
173
}, nil
161
174
}
162
175
176
+ func rootFileSystemType (p * BuildrootProvisioner ) (string , error ) {
177
+ fs , err := p .SSHCommand ("df --output=fstype / | tail -n 1" )
178
+ if err != nil {
179
+ return "" , err
180
+ }
181
+ return strings .TrimSpace (fs ), nil
182
+ }
183
+
163
184
// Package installs a package
164
185
func (p * BuildrootProvisioner ) Package (name string , action pkgaction.PackageAction ) error {
165
186
return nil
0 commit comments