0

I have a folder : /docker on my project root and it contains certain files like Apache configs which I need to copy to the correct folders during teh build.

Project-root
------docker folder
-----------apache.conf

Now

DOCKERFILE

In my dockerfile i have a copy command which copies the whole of root to the container.

`Issue`

I don't want the docker folder to be copied to the built image.

I added docker to the .dockerignore. But this leads to the problem that these files are not sent to the build context and then the build command fails.

WORKAROUND

Use the RUN command in the dockerfile to remove the docker folder instead of using .dockerignore

QUESTION

Is there any better solution?

DOCKER FILe:
FROM <baseimage>
WORKDIR /var/www/html/
COPY . /var/www/html/MYFOLDER
COPY ./docker/apache.conf /etc/httpd/conf/apache.conf
COPY ./docker/sites-enabled /etc/httpd/sites-enabled
Bhumi Singhal
  • 8,063
  • 10
  • 50
  • 76

0 Answers0