[release] v0.5.3 - Support CPU without AVX
This commit is contained in:
parent
4e70cdfc60
commit
84ceae0591
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
|
|
@ -8,6 +8,9 @@ import (
|
|||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/mount"
|
||||
|
||||
"runtime"
|
||||
"golang.org/x/sys/cpu"
|
||||
)
|
||||
|
||||
type VolumeMount struct {
|
||||
|
@ -21,8 +24,16 @@ func NewDB() (string, error) {
|
|||
mongoPass := utils.GenerateRandomString(24)
|
||||
monHost := "cosmos-mongo-" + id
|
||||
|
||||
imageName := "mongo:latest"
|
||||
|
||||
// if CPU is missing AVX, use 4.4
|
||||
if runtime.GOARCH == "amd64" && !cpu.X86.HasAVX {
|
||||
utils.Warn("CPU does not support AVX. Using mongo 4.4")
|
||||
imageName = "mongo:4.4"
|
||||
}
|
||||
|
||||
err := RunContainer(
|
||||
"mongo:latest",
|
||||
imageName,
|
||||
monHost,
|
||||
[]string{
|
||||
"MONGO_INITDB_ROOT_USERNAME=" + mongoUser,
|
||||
|
|
Loading…
Reference in a new issue