I’m having issues installing swipl with scasp into a container using the Dockerfile I was using before.
The Dockerfile is as follows:
# Use an official SWI-Prolog image from the Docker Hub
FROM swipl:latest
# Set the working directory
WORKDIR /app
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
unzip \
git \
make \
wget && \
rm -rf /var/lib/apt/lists/*
# Install sCASP from the github repository.
RUN set -eux; \
wget https://github.com/SWI-Prolog/sCASP/archive/refs/heads/master.zip ; \
unzip master.zip; \
mv sCASP-master sCASP; \
rm master.zip
RUN ln -s /usr/lib/swipl/bin/x86_64-linux/swipl /usr/local/bin/swipl
RUN set -eux; \
cd sCASP; \
swipl -g "pack_install('.',[interactive(false)])" -t halt
# Copy your Prolog files into the container
COPY *.pl /app
# Expose the port
EXPOSE 8080
# Run SWI-Prolog with the script
CMD ["swipl", "-g", "server(8080)", "scasp_server.pl"]]
Until recently, it ran as expected, but now on the swipl -g "pack_install...
line, it generates the following error:
% Building pack scasp in directory /usr/share/swi-prolog/pack/scasp
/usr/lib/swipl/bin/x86_64-linux/swipl --no-pce --undefined=error -O -o scasp -c prolog/scasp/main.pl
% Disabled autoloading (loaded 146 files)
% Disabled autoloading (loaded 34 files)
% Disabled autoloading (loaded 0 files)
ERROR: The predicates below are not defined. If these are defined
% ERROR: at runtime using assert/1, use :- dynamic Name/Arity.
% ERROR:
% ERROR: html_meta_head/3, which is referenced by
% ERROR: /usr/lib/swipl/library/prolog_source.pl:270:19: 6-th clause of update_state/2
% ERROR: start_emacs/0, which is referenced by
% ERROR: /usr/lib/swipl/library/ext/pldoc/doc_http.pl:246:8: 1-st clause of prepare_editor/0
gmake: *** [Makefile:9: scasp] Error 1
ERROR: -g pack_install('.',[interactive(false)]): Process "process(/usr/bin/gmake,[])": exit status: 2
I’m not sure what to make of that other than that there has been some sort of change to swipl:latest that makes it stop working. I’ll play with different versions of the container image, and see if I can find out where the problem started, and update the thread if I can figure it out.
I’m imagining I probably need to add some install commands to the Dockerfile, but ChatGPT’s guesses aren’t helping.
Thanks!