MCPcopy
hub / github.com/caprover/caprover / checkSystemReq

Function checkSystemReq

src/utils/CaptainInstaller.ts:12–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10// No need to directly use Public IP.
11
12function checkSystemReq() {
13 return Promise.resolve()
14 .then(function () {
15 return DockerApi.get().getDockerVersion()
16 })
17 .then(function (output) {
18 console.log(' ')
19 console.log(' ')
20 console.log(' ')
21 console.log(' >>> Checking System Compatibility <<<')
22
23 const ver = output.Version.split('.')
24 const maj = Number(ver[0])
25 const min = Number(ver[1])
26
27 let versionOk = false
28
29 if (maj > 17) {
30 versionOk = true
31 } else if (maj === 17 && min >= 6) {
32 versionOk = true
33 }
34
35 if (versionOk) {
36 console.log(' Docker Version passed.')
37 } else {
38 console.log(
39 'Warning!! Minimum Docker version is 17.06.x CapRover may not run properly on your Docker version.'
40 )
41 }
42
43 return DockerApi.get().getDockerInfo()
44 })
45 .then(function (output) {
46 if (output.OperatingSystem.toLowerCase().indexOf('ubuntu') < 0) {
47 console.log(
48 '******* Warning ******* CapRover and Docker work best on Ubuntu - specially when it comes to storage drivers.'
49 )
50 } else {
51 console.log(' Ubuntu detected.')
52 }
53
54 const totalMemInMb = Math.round(output.MemTotal / 1000.0 / 1000.0)
55
56 if (totalMemInMb < 1000) {
57 console.log(
58 '******* Warning ******* With less than 1GB RAM, Docker builds might fail, see CapRover system requirements.'
59 )
60 } else {
61 console.log(` Total RAM ${totalMemInMb} MB`)
62 }
63 })
64 .catch(function (error) {
65 console.log(' ')
66 console.log(' ')
67 console.log(
68 '**** WARNING!!!! System requirement check failed! *****'
69 )

Callers 1

installFunction · 0.85

Calls 4

getDockerVersionMethod · 0.80
logMethod · 0.80
getDockerInfoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected