Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumbed version to 7.7.1. Also #8

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions 7.7.1/stretch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM debian:stretch-slim
LABEL maintainer "Dave Curylo <[email protected]>, Michael Hendricks <[email protected]>"

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libarchive13 \
libgmp10 \
libossp-uuid16 \
libssl1.1 \
ca-certificates \
libdb5.3 \
libpcre3 \
libedit2 \
libgeos-c1v5 \
libspatialindex4v5 \
unixodbc \
odbc-postgresql \
tdsodbc \
libmariadbclient18 && \
rm -rf /var/lib/apt/lists/*

ENV SWIPL_VER 7.7.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was avoiding these, as each directive results in a new image layer, albeit a small one. If we switch to a multi-stage build, that's largely irrelevant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, let us create layers. Do you do this or do you leave it to me?

ENV SWIPL_CHECKSUM fda2c8b6b606ff199ea8a6f019008aa8272b7c349cb9312ccd5944153509503a
ENV BUILD_DEPS make gcc g++ wget libarchive-dev libgmp-dev libossp-uuid-dev libpcre3-dev \
libreadline-dev libedit-dev libssl-dev zlib1g-dev libdb-dev libgeos++-dev \
libspatialindex-dev unixodbc-dev git autoconf

ENV SPACE_SHA1 cd6fefa63317a7a6effb61a1c5aee634ebe2ca05

RUN apt-get update && apt-get install -y --no-install-recommends ${BUILD_DEPS} && \
mkdir /tmp/src && \
cd /tmp/src && \
wget http://www.swi-prolog.org/download/devel/src/swipl-${SWIPL_VER}.tar.gz && \
echo "${SWIPL_CHECKSUM} swipl-${SWIPL_VER}.tar.gz" >> swipl-${SWIPL_VER}.tar.gz-CHECKSUM && \
sha256sum -c swipl-${SWIPL_VER}.tar.gz-CHECKSUM && \
tar -xzf swipl-${SWIPL_VER}.tar.gz && \
cd swipl-${SWIPL_VER} && \
cp build.templ build && \
sed -i '/PREFIX=$HOME/c\PREFIX=/swipl' build && \
sed -i '/# export DISABLE_PKGS/c\export DISABLE_PKGS="jpl xpce"' build && \
sed -i 's/# *\(.*--disable-libdirversion\)/\1/' build && \
chmod u+x build && ./build && \
rm -r /tmp/src && \
cd /usr/bin && ln -s /swipl/bin/swipl swipl && \
mkdir /swipl/lib/swipl/pack && \
cd /swipl/lib/swipl/pack && \
git clone https://github.com/JanWielemaker/space.git && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this make sense as an additional image tag, i.e. swipl:7.1.1-space? It could be based off the 7.1.1 release, but adds space. We could have another Dockerfile that is little more than FROM swipl and then RUN for the space build. Or should this always be part of the full image?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm against a -space. We have SWI-Prolog's real core, its library that is bundled with the core, its packages that are bundled in the tar archive and can be compiled separately and community packages. None of the boundaries are very hard. Space went from the 2nd to the 3rd class because it is fairly hard to install in arbitrary environments, causing lots of porting issues while it is not vital. I got feedback from two people telling me that including space was a good idea (they looked at the Dockerfile and saw it included), so I first wanted to make that work.

Supporting space in the docker image doesn't change much of its size, while in the controlled Debian stretch environment we can get it installed fairly easily. The same goes for a couple of other add-ons, I think some 3 or 4. They add seconds to the build time and altogether probably a couple of Mb to the image size. Including them will make the image read-to-use for a significantly larger class of server tasks without having to setup the build essentials and add them to your own image. I think there are two options:

  • Just include them
  • Have a swipl:xl version.

Considering simplicity for the users I'm in favour of (1). Note that we are only interested in mixed C/Prolog add-ons. Pure Prolog ones are installed very quickly.

In particular when we have a layered Dockerfile the thing should be quite manageable. I'll spend some time adding this stuff today. Getting it to build is hard, while reorganizing is quick.

(cd space && git checkout -q ${SPACE_SHA1}) && \
(cd space && ln -s configure.ac configure.in) && \
swipl -g 'pack_rebuild(space)' -t halt && \
apt-get purge -y --auto-remove ${BUILD_DEPS} && \
rm -rf /var/lib/apt/lists/*

ENV LANG C.UTF-8
CMD ["swipl"]