I've got Dockerfile:
FROM prom/prometheus
RUN rm -f /etc/prometheus/prometheus.yml
ADD config/ /etc/prometheus/
RUN echo $ACTUATOR_PASSWORD > /etc/prometheus/actuator_password
And docker-compose that contains:
prometheus:
image: szastarek/food-delivery-prometheus
container_name: prometheus
environment:
- ACTUATOR_PASSWORD=iN09KtaW59dqeRylgZFV4aSZ
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
networks:
food-delivery-net:
aliases:
- "prometheus"
The problem is with actuator_password file that is creating in dockerfile. The file should contain a password that is passed in environment variable but it's empty. So how can I create file inside docker container that will contain password passed in env?