Reputation: 3772
I'm using docker-compose to build my images and run my services. Now I want to install some dependencies such as GIT and other third party. This is needed to build the application itself because other dependencies of the application pulls its content from git.
I have this as content of my docker-compose.yml
web:
image: nginx:latest
ports:
- "9090:80"
volumes:
- ./exam:/var/www/html/exam
- ./default.conf:/etc/nginx/conf.d/default.conf
links:
- php
php:
image: php:7-fpm
ports:
- "9000:9000"
volumes:
- ./exam:/var/www/html/exam
links:
- elk
elk:
image: sebp/elk
ports:
- "5601:5601"
- "9200:9200"
- "5044:5044"
Now on my Dockerfile I have this
FROM php:7-fpm
COPY ./exam /var/www/html/exam
RUN apt-get update && apt-get install git -y
WORKDIR /var/www/html/exam
But upon running docker-compose up --build or docker-compose up -d the PHP7-fpm image still doesn't contain any git. Any idea on how to fix this?
Upvotes: 0
Views: 162
Reputation: 42040
You are building the image from the Dockerhub image, rather than using the local Dockerfile:
remove image
from php
section and add build: .
instead (.
should be the directory where the Dockerfile
resides).
Upvotes: 1