我目前正在树莓派3型B +上使用docker。我正在尝试在docker中安装MySQL。 Docker处于群集模式(目前为单个节点)。
我选择部署预构建的arm32v7 MySQL映像。 我正在通过docker stack deploy进行部署
docker stack deploy --compose-file docker-compose.yml mysql
我的撰写文件如下
version: '3.4'
secrets:
DBROOT_PASSWORD:
external: true
services:
db:
image: tobi312/rpi-mysql:latest
volumes:
- /usr/mysql/data:/var/lib/mysql
secrets:
- DBROOT_PASSWORD
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/DBROOT_PASSWORD
现在我遇到的问题是,在部署服务时,有时会尝试以amd64架构模式进行部署。这似乎是随机发生的,我无法查明原因。我已经尝试过更改很多事情,但看起来还是随机的。
有什么理由会随机发生吗?
这是来自2个部署的两个独立的docker service inspect
输出,而无需更改文件组成。
第一个:
[
{
"ID": "lrd4nu4gujmc31v5t1cx4m2j8",
"Version": {
"Index": 1824
},
"CreatedAt": "2018-11-25T15:04:30.786521779Z",
"UpdatedAt": "2018-11-25T15:04:30.790834401Z",
"Spec": {
"Name": "mysql_db",
"Labels": {
"com.docker.stack.image": "tobi312/rpi-mysql:latest",
"com.docker.stack.namespace": "mysql"
},
"TaskTemplate": {
"ContainerSpec": {
"Image": "tobi312/rpi-mysql:latest",
"Labels": {
"com.docker.stack.namespace": "mysql"
},
"Env": [
"MYSQL_ROOT_PASSWORD_FILE=/run/secrets/DBROOT_PASSWORD"
],
"Privileges": {
"CredentialSpec": null,
"SELinuxContext": null
},
"Mounts": [
{
"Type": "bind",
"Source": "/usr/mysql/data",
"Target": "/var/lib/mysql"
}
],
"StopGracePeriod": 10000000000,
"DNSConfig": {},
"Secrets": [
{
"File": {
"Name": "DBROOT_PASSWORD",
"UID": "0",
"GID": "0",
"Mode": 292
},
"SecretID": "r7hcdz7dhybcl6pzrxi7gucja",
"SecretName": "DBROOT_PASSWORD"
}
],
"Isolation": "default"
},
"Resources": {},
"RestartPolicy": {
"Condition": "any",
"Delay": 5000000000,
"MaxAttempts": 0
},
"Placement": {},
"Networks": [
{
"Target": "zthy3wyo4auf5r8sxsx6tmiss",
"Aliases": [
"db"
]
}
],
"ForceUpdate": 0,
"Runtime": "container"
},
"Mode": {
"Replicated": {
"Replicas": 1
}
},
"UpdateConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"RollbackConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"EndpointSpec": {
"Mode": "vip"
}
},
"Endpoint": {
"Spec": {
"Mode": "vip"
},
"VirtualIPs": [
{
"NetworkID": "zthy3wyo4auf5r8sxsx6tmiss",
"Addr": "10.0.20.9/24"
}
]
}
}
]
第二个:
[
{
"ID": "bpzbl2istgu6m8vmaru50nlj8",
"Version": {
"Index": 1804
},
"CreatedAt": "2018-11-25T15:02:22.484137543Z",
"UpdatedAt": "2018-11-25T15:02:22.488271468Z",
"Spec": {
"Name": "mysql_db",
"Labels": {
"com.docker.stack.image": "tobi312/rpi-mysql:latest",
"com.docker.stack.namespace": "mysql"
},
"TaskTemplate": {
"ContainerSpec": {
"Image": "tobi312/rpi-mysql:latest@sha256:75d4cca6e19e78b18cdd6ae37eaa11e9fe0bb13e4e819b865cc2826c0bd05091",
"Labels": {
"com.docker.stack.namespace": "mysql"
},
"Env": [
"MYSQL_ROOT_PASSWORD_FILE=/run/secrets/DBROOT_PASSWORD"
],
"Privileges": {
"CredentialSpec": null,
"SELinuxContext": null
},
"Mounts": [
{
"Type": "bind",
"Source": "/usr/mysql/data",
"Target": "/var/lib/mysql"
}
],
"StopGracePeriod": 10000000000,
"DNSConfig": {},
"Secrets": [
{
"File": {
"Name": "DBROOT_PASSWORD",
"UID": "0",
"GID": "0",
"Mode": 292
},
"SecretID": "r7hcdz7dhybcl6pzrxi7gucja",
"SecretName": "DBROOT_PASSWORD"
}
],
"Isolation": "default"
},
"Resources": {},
"RestartPolicy": {
"Condition": "any",
"Delay": 5000000000,
"MaxAttempts": 0
},
"Placement": {
"Platforms": [
{
"Architecture": "amd64",
"OS": "linux"
}
]
},
"Networks": [
{
"Target": "zthy3wyo4auf5r8sxsx6tmiss",
"Aliases": [
"db"
]
}
],
"ForceUpdate": 0,
"Runtime": "container"
},
"Mode": {
"Replicated": {
"Replicas": 1
}
},
"UpdateConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"RollbackConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"EndpointSpec": {
"Mode": "vip"
}
},
"Endpoint": {
"Spec": {
"Mode": "vip"
},
"VirtualIPs": [
{
"NetworkID": "zthy3wyo4auf5r8sxsx6tmiss",
"Addr": "10.0.20.4/24"
}
]
}
}
]