docker: Fix debian/Dockerfile filepath and README doc

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 <theo.lebrun@bootlin.com>
This commit is contained in:
Théo Lebrun 2024-04-29 10:57:01 +02:00 committed by Michael Opdenacker
parent 834806ea5b
commit c8bcfc8306
2 changed files with 8 additions and 6 deletions

View file

@ -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 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 --build-arg GIT_REPO_URL=git://git.musl-libc.org/musl --build-arg PROJECT=musl .
$ 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`):

View file

@ -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 && \