首页 > 解决方案 > 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

标签: dockerdocker-compose

解决方案


似乎您只缺少命令和环境变量(您应该填写它们的值)

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"'

编辑:添加缺少的引号


推荐阅读