无法在RUN script.sh Dockerfile中访问env变量

时间:2017-02-24 16:29:29

标签: bash docker docker-compose

我有这个Dockerfile:

FROM php:5.6-apache
WORKDIR /var/www/html/

# ENV VARIABLES
ENV INI_FOLDER /usr/local/etc/php
ENV WWW_FOLDER /var/www

# ADD THE ENV CONFIGURATOR AND SET PERMISSIONS
ADD env.sh $WWW_FOLDER/
RUN chmod +x $WWW_FOLDER/env.sh

RUN /var/www/env.sh

问题在于env.sh我无法访问docker-compose上设置的变量。有没有解决方法来解决这个问题?

更新:添加了docker-compose

version: '2.0'

services:
  app:
    env_file:
      - app/mysql.env
      - app/app.env
    volumes:
      - C:\Users\svirl\Documents\workspace\docker\my-app:/var/www/html/:rw
    build: app

0 个答案:

没有答案