简体   繁体   English

Docker 撰写文件上的自定义运行参数

[英]Docker custom run params on compose file

I need to run a docker container using this command我需要使用此命令运行 docker 容器

docker run --rm -it -p 5000:5000 --memory 4g --cpus 4 \
mcr.microsoft.com/azure-cognitive-services/speechservices/speech-to-text \
Eula=accept \
Billing={ENDPOINT_URI} \
ApiKey={API_KEY}

But I need to run it via a docker compose file, and can't manage to set the parameters Eula, Billing and ApiKey.但我需要通过 docker 撰写文件运行它,并且无法设置参数 Eula、Billing 和 ApiKey。 Any hints on how that could be achieved?关于如何实现的任何提示?

I managed to make it work with @Zeitounator suggestion我设法使它与@Zeitounator 的建议一起工作

The docker compose file end looking like this: docker 组合文件结尾如下所示:

version: '3'
services:
  scriptme-ml-model:
    image: mcr.microsoft.com/azure-cognitive-services/speechservices/speech-to-text
    ports:
      - 5000:5000
    deploy:
        resources:
            limits:
              cpus: 2
              memory: 2g
            reservations:
              cpus: 2
              memory: 2g
    command: >
      Eula=accept
      Billing={ENDPOINT_URI}
      ApiKey={API_KEY}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM