How to substitute variable value in “docker run” command

浪子不回头ぞ 提交于 2019-12-20 06:33:51

问题


I am using a bash script and trying to assign a fingerprint value as below

export FINGERPRINT=D0:19:C5:80:42:66:56:AC:6F  
docker run --rm -i -v /var/run/docker.sock:/var/run/docker.sock --name ucp docker/ucp join --replica --fingerprint $FINGERPRINT

However, bash is not at all substituting the value of $FINGERPRINT


回答1:


Try this:

export FINGERPRINT=D0:19:C5:80:42:66:56:AC:6F
echo `docker run --rm -i -v /var/run/docker.sock:/var/run/docker.sock --name ucp docker/ucp join --replica --fingerprint $FINGERPRINT`


来源:https://stackoverflow.com/questions/36876613/how-to-substitute-variable-value-in-docker-run-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!