我正在为我的 Docker 应用程序编写 Makefile。我有 make start-image
,它使用默认命令启动图像:
start-image:
docker run name
make do_something
这将附加应该在 docker 容器中运行的命令:do_something:
docker run name command args
最佳答案
使用变量存储命令的公共(public)部分
RUNTOOL=docker run name
start-image:
${RUNTOOL}
do-something:
${RUNTOOL} command args
https://stackoverflow.com/questions/35002364/