From c8bcfc83067339e738fa84937de0f61bcda5806a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Lebrun?= Date: Mon, 29 Apr 2024 10:57:01 +0200 Subject: [PATCH] docker: Fix debian/Dockerfile filepath and README doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two things get fixed here: - README says downloading Dockerfile is enough. It is not; Debian Dockerfile requires docker/debian/000-default.conf file. - docker/debian/Dockerfile links to 000-default.conf file using: COPY ./docker/debian/000-default.conf /etc/apache2/sites-available/000-default.conf This means following command in README cannot work: docker build [...] . Either you set cwd to root Git repo and Dockerfile is not found, or you set cwd to docker/debian/ and 000-default.conf is not found. Correct command would be: docker build -f docker/debian/Dockerfile [...] . We fix Dockerfile by expecting 000-default.conf to be in cwd. We fix README by rewording the paragraph and updating commands to work based on Git repo root directory. Signed-off-by: Théo Lebrun --- README.adoc | 14 ++++++++------ docker/debian/Dockerfile | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.adoc b/README.adoc index 0cae9184..ffba2432 100644 --- a/README.adoc +++ b/README.adoc @@ -357,12 +357,14 @@ where all repositories are found. = Building Docker images -Docker files are provided in the `docker/` directory. To generate your own -Docker image for indexing the sources of a project (for example for the Musl -project which is much faster to index than Linux), download the `Dockerfile` -file for your target distribution and run: - - $ docker build -t elixir --build-arg GIT_REPO_URL=git://git.musl-libc.org/musl --build-arg PROJECT=musl . +Docker files are provided in the `docker/` directory. To generate a Docker image +for indexing the sources of a project, first fetch the Elixir repository. Then +pick the project you want to index (Musl is nice test data being not too slow +to index) and your target distribution (`debian` and `centos` available), and +run: + + $ docker build -t elixir-debian --build-arg GIT_REPO_URL=git://git.musl-libc.org/musl --build-arg PROJECT=musl ./docker/debian/ + $ docker build -t elixir-centos --build-arg GIT_REPO_URL=git://git.musl-libc.org/musl --build-arg PROJECT=musl ./docker/centos/ Then you can use your new container as follows (you get the container id from the output of `docker build`): diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 0a851f84..d5c0cc59 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -68,7 +68,7 @@ RUN \ # apache elixir config, see elixir README # make apache less stricter about cgitb spam headers -COPY ./docker/debian/000-default.conf /etc/apache2/sites-available/000-default.conf +COPY ./000-default.conf /etc/apache2/sites-available/000-default.conf RUN \ echo -e "\nHttpProtocolOptions Unsafe" >> /etc/apache2/apache.conf && \