When I run docker-compose build && docker-compose up redis, with the environmentspecified in docker-compose.yamland RUN envin Dockerfile, the environment variables that I set are not printed.
Why is this not working?
I am using docker-composeversion 1.4.2.
Here are the relevant files:
docker-compose.yamlwith environmentas a list of pairs KEY=value:
redis:
build: ../storage/redis
ports:
- "6379:6379"
environment:
- FOO='bar'
docker-compose.yamlwith environmentas a dictionary:
redis:
build: ../storage/redis
ports:
- "6379:6379"
environment:
- FOO: 'bar'
Dockerfile:
FROM redis:2.6
MAINTAINER me@email.com
RUN mkdir -p /var/redis && chown -R redis:redis /var/redis
RUN echo '-------------- env ---------------'
RUN env
COPY redis.conf /usr/local/etc/redis/redis.conf
EXPOSE 6379
ENTRYPOINT ["redis-server", "/usr/local/etc/redis/redis.conf"]
source
share