docker-compose args from shell

前端 未结 3 2195
醉酒成梦
醉酒成梦 2021-02-14 19:04

I want to build via the docker-compose an image that uses my private key for cloning private git repos.

More or less the compose becomes as fol

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-14 19:31

    You can use the same syntax with docker-compose build:

    docker-compose build --build-arg RSA="$(cat ~/.ssh/id_rsa)"
    

    Unfortunately, you can't use the build-args option with compose up or start... So you will need to build and then run using the --no-build option

提交回复
热议问题