Declare env variable which value include space for docker/docker-compose

前端 未结 3 1449
清歌不尽
清歌不尽 2020-12-18 22:12

I have an env variable value like this:
TEST_VAR=The value

Do anybody knowns whether this is legal? should I place \" around the value

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-18 22:43

    In Dockerfile use doublequotes, do not use singlequotes because they do not expand variables inside, excerp from passing buildargs/envs to dockerfile and into a python script below:

    ARG HOST="welfare-dev testapi"
    ENV HOST "${HOST}"
    ARG SITENAME="Institusjon"
    ENV SITENAME "${SITENAME}"
    RUN cd ${TESTDIR}/sensiotools/sensiotools && cd test && \
      ./testapi-events.py --activate --sitename="${SITENAME}" --host="${HOST}" --dbcheck --debug --wait=0.5 && \
      ./testapi-events.py --deactivate --sitename="${SITENAME}" --host="${HOST}" --dbcheck --debug
    

提交回复
热议问题