S
S
superkolya2019-07-06 16:46:30
Docker
superkolya, 2019-07-06 16:46:30

Where do files go when docker-compose build?

There is docker-compose.yaml:

version: "3.1"
services:
  php-fpm:
    build:
      context: phpdocker/php-fpm
      args:
        - GITLAB_USER
        - GITLAB_DEPLOY_TOKEN
    container_name: project-local-php-fpm
    working_dir: /application
    volumes:
      - ./app:/application
      - ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.1/fpm/conf.d/99-overrides.ini
      - ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.1/cli/conf.d/99-overrides.ini

And there is a Dockerfile with which the container is built:
FROM phpdockerio/php71-fpm:latest

WORKDIR "/application"

# Install selected extensions and other stuff
RUN apt-get update \
    && apt-get -y --no-install-recommends install php-memcached php7.1-pgsql php-redis php7.1-bcmath php7.1-gd php7.1-gmp php7.1-imap php-imagick php7.1-soap php-ssh2 php-yaml php-xdebug php7.1-dev make wget \
    && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

# Install git
RUN apt-get update \
    && apt-get -y install git \
    && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

ARG GITLAB_USER
ARG GITLAB_DEPLOY_TOKEN

#install application
RUN git clone --progress --verbose http://$GITLAB_USER:[email protected]/project.git . \
  && git checkout -b develop origin/develop \
  && composer install

I start the build with the command
docker-compose build --build-arg GITLAB_USER=ololo --build-arg GITLAB_DEPLOY_TOKEN=trololo

Everything starts well, builds, the repository tends, composer dependencies are installed, this can be judged by the console output. But on the host machine, there are no files that were inclined from the repository, nor those packages that composer downloaded. Plz tell me what i'm doing wrong

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2019-07-08
@superkolya

The volumes specified in docker-compose.ymlare mounted at startup, not when the container is built.
Either nothing, or dependency packages, or a complete set should get into the image, in the first 2 options, the missing should be monitored from the host.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question