docker - Convert docker run command to docker-compose
问题描述
I would like to transform this docker run command to docker-compose. Unfortunately I don’t know how to transform the last part of it.
docker-run
docker run \
-p 6600:6600 \
-p 6680:6680 \
trestrantham/docker-mopidy-spotify \
mopidy \
-o spotify/username=USERNAME \
-o spotify/password=PASSWORD \
-o audio/output="lamemp3enc ! shout2send mount=mopidy ip=192.168.99.100 port=8000 password=mopidy"
Here is what I´ve got so far:
docker-compose.yml
version: '3.3'
services:
mopidy:
ports:
- '6600:6600'
- '6680:6680'
image: trestrantham/docker-mopidy-spotify
Any help is appreciated.
Thanks
解决方案
似乎您只缺少命令和环境变量(您应该填写它们的值)
version: '3.3'
services:
mopidy:
ports:
- '6600:6600'
- '6680:6680'
image: trestrantham/docker-mopidy-spotify
environment:
- USERNAME=___USERNAME___
- PASSWORD=___PASSWORD___
command: 'mopidy -o spotify/username=$USERNAME -o spotify/password=$PASSWORD -o audio/output="lamemp3enc ! shout2send mount=mopidy ip=192.168.99.100 port=8000 password=mopidy"'
编辑:添加缺少的引号
推荐阅读
- azure - 保护 Azure 中的微服务使用的资源连接数据/字符串
- angular - 在 Angular、Material 和 Flex-Layout 上以 mat-progress-spinner 为中心的叠加文本
- javascript - 量角器黄瓜框架未识别规范文件
- ms-access - 测试 ODBC 链接表是否可用
- mysql - 在 INSERT INTO 语句中使用 FROM_UNIXTIME
- javascript - SVG.js:referenceError SVG 未定义
- ios - 在不调用每个 viewDidAppear 的情况下解雇 rootViewController
- templates - Thymeleaf 模板的易读性更好
- gstreamer - 在单独的分支中并行处理相同的数据
- c - C 编程递归问题生成段错误