我有以下run.sh
脚本:
#!/bin/bash
if [[ "$1" = build ]]
then
python -m flask run --host=0.0.0.0
else
echo "$1"
fi
以及以下Dockerfile
定义:
FROM python:3
COPY "app.py" /
COPY "requirements.txt" /
COPY "run.sh" /
RUN ["pip", "install", "-r", "requirements.txt"]
RUN ["chmod", "+x", "/run.sh"]
ENV FLASK_APP app.py
EXPOSE 5000
ENTRYPOINT /run.sh
CMD build
./run.sh foo
打印出foo
,但是docker build . -t test; docker run test
打印出空行。怎么会来?
答案 0 :(得分:2)
对CMD和ENTRYPOINT行使用json / exec语法。否则,docker将使用shell包装命令:
if (menuItem.attr('aria-expanded') === 'true') {
$(this).attr('aria-expanded', 'false');
} else {
$(this).attr('aria-expanded', 'true');
$(this).siblings('li').attr('aria-expanded', 'false');
}
有关两种语法如何相互作用的更多详细信息,请参见table in this documentation。