What I want is for this dockerfile to clone into the host machine (mine) and I'll copy it over as a volume, but instead it's cloning it directly into the container instead.
This is the dockerfile:
FROM php:7.4-apache
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y
RUN a2enmod ssl && a2enmod rewrite
RUN a2enmod include
# Install software
RUN apt-get install -y git
WORKDIR /
RUN git clone mygitrepo.git /test
I also have a different dockerfile that used to write to host, but doesn't anymore:
FROM nginx:1.19.1-alpine
RUN apk update && \
apk add --no-cache openssl && \
openssl req -x509 -nodes -days 365 \
-subj "/C=CA/ST=QC/O=Company Inc/CN=example.com" \
-newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key \
-out /etc/ssl/certs/nginx-selfsigned.crt;
I'm not sure where the root of the problem is. here's the docker-compose file that I use to start this:
version: '3.7'
services:
build:
build:
context: .
dockerfile: build.Dockerfile
networks:
- web
apache:
container_name: Apache
build:
context: ./apache
dockerfile: apache.Dockerfile
ports:
- '127.0.0.1:80:80'
- '127.0.0.1:443:443'
networks:
- web
networks:
web:
volumes:
dump:
I removed a lot of extra stuff so it may appear it doesn't start at all. The containers run fine. The servers run fine. I just want it to write to host and not just the container which is what it's doing. I'm having difficulty googling this. I'm running a macos.
Thank you in advance! :D