Comments (3)
这里我看了下,这个地方 compose 文件里写 bool 值是其实不正确的,可能是我使用的 compose 插件版本做了额外的转换,能够正常使用,但是实际这个写法不是标准的。
YAML 文件支持 bool 类型的 value,但是对于环境变量来说, linux 环境变量都是字符串,如果在 compose 文件里用 map 的形式编写 env,value 又是 bool类型的话,解析器就会把那个值解析为 bool,但是linux 的环境变量需要的字符串,这个地方类型不匹配,你贴的报错日志就是这个情况。
docker 官方的文档是有提到环境变量所有的 bool 值都必须要用引号包起来,参见这里
https://docs.docker.com/compose/compose-file/compose-file-v3/#environment
看起来是个已知的问题。保险起见我后续会把项目中这种写法全部改掉
from rssmanx.
目前不清楚是哪个版本开始对上面说的那个情况做了兼容,我本地使用的版本没有出现这个问题,贴一下我本地使用的 os 和版本,供参考
➜ uname -a
Linux light-sg 6.1.0-11-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux
➜ docker compose version
Docker Compose version v2.21.0
➜ docker version
Client: Docker Engine - Community
Version: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:08:02 2023
OS/Arch: linux/amd64
Context: default
➜ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
from rssmanx.
非常抱歉,我忘记把自己的服务器环境贴上来了,下面是我自己的服务器环境
➜ uname -a
Linux BlogServer 5.10.0-0.deb10.27-rt-amd64 #1 SMP PREEMPT_RT Debian 5.10.205-2~deb10u1 (2024-01-04) x86_64 GNU/Linux
➜ docker compose version
Docker Compose version v2.24.7
➜ docker version
Client: Docker Engine - Community
Version: 25.0.4
API version: 1.44
Go version: go1.21.8
Git commit: 1a576c5
Built: Wed Mar 6 16:32:13 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 25.0.4
API version: 1.44 (minimum version 1.24)
Go version: go1.21.8
Git commit: 061aa95
Built: Wed Mar 6 16:32:13 2024
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
➜ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
我查询了一下 Docker Compose 相关的更新日志:
https://docs.docker.com/compose/release-notes/#170
1.7.0 Breaking Changes 中的第二条
Booleans are no longer allows as values for mappings in the Compose file (for keys
environment
,labels
and extra_hosts). Previously this was awarning
. Boolean values should be quoted so they become string values.
https://docs.docker.com/compose/release-notes/#bug-fixes-26
1.19.0 Bug fixes 中的最后一条
Added better validation of
labels
fields in Compose files. Label values containing scalar types (number, boolean) now get automatically converted to strings
所以这解释了在 labels
字段中的的布尔值不用引号包起来不会报错,而在 environment
字段中的布尔值不用引号包起来会报错的原因。
估计您应该使用了什么插件让其自动添加了引号。
from rssmanx.
Related Issues (18)
- 为什么rsshub无法通过浏览器打开? HOT 5
- 你好,碰见个新问题,为什么选择ultimate版本自建后wemp仍然被屏蔽? HOT 3
- 非常好用,求更新个带nginx的:) HOT 2
- 甲骨文arm报错 HOT 5
- 请问如何调用rsshub HOT 1
- 使用lite.yml为什么ttrss插件里有mercury HOT 1
- 使用 Ultimate 版自建时,出现大量错误 failed to create shim task: OCI runtime creat HOT 1
- 为啥我新建的默认配置docker无法生效? HOT 4
- 如何在服务器内部调用browserless? HOT 1
- ttrss 日志报错 HOT 4
- 安装后ttrss跑不起来 HOT 16
- 关于ttrss 使用github自带的 rss源没法使用的问题 HOT 3
- 关于在安卓端使用feedme 无法获取订阅内容的询问 HOT 5
- 关于github官方rss源的问题 HOT 4
- sudo docker compose up -d一直失败 HOT 5
- 关于ultimate clash规则的问题 HOT 16
- huginn 外网无法访问,启动报错 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rssmanx.