Skip to content

Commit c07e808

Browse files
committed
Added support for specifying SWI-Prolog version in Docker image (#3)
Reviewed-on: http://bit:3000/yuce/pyswip/pulls/3 Co-authored-by: Yuce Tekol <yucetekol@gmail.com> Co-committed-by: Yuce Tekol <yucetekol@gmail.com>
1 parent e961566 commit c07e808

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.PHONY: build clean coverage upload-coverage test upload docker
22

33
DOCKER ?= docker
4+
SWIPL_VERSION ?= 9.0.4
45

56
build:
67
pyproject-build
@@ -28,4 +29,4 @@ reformat:
2829
ruff format
2930

3031
docker:
31-
$(DOCKER) build -t quay.io/ytekol/pyswip:latest -f docker/Dockerfile .
32+
$(DOCKER) build -t quay.io/ytekol/pyswip:latest-swipl-${SWIPL_VERSION} -f docker/Dockerfile --build-arg swipl_version=$(SWIPL_VERSION) .

docker/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM docker.io/debian:stable-slim AS build
22

3+
ARG swipl_version
4+
35
RUN useradd -m sam
46

57
RUN \
@@ -23,9 +25,9 @@ WORKDIR /home/sam
2325
USER sam
2426

2527
RUN \
26-
curl -LO https://www.swi-prolog.org/download/stable/src/swipl-10.0.0.tar.gz && \
27-
tar xf swipl-10.0.0.tar.gz && \
28-
cd swipl-10.0.0 && \
28+
curl -LO https://www.swi-prolog.org/download/stable/src/swipl-${swipl_version}.tar.gz && \
29+
tar xf swipl-${swipl_version}.tar.gz && \
30+
cd swipl-${swipl_version} && \
2931
cmake \
3032
-B build \
3133
-G Ninja \
@@ -38,7 +40,7 @@ RUN \
3840
USER root
3941

4042
RUN \
41-
cmake --install /home/sam/swipl-10.0.0/build
43+
cmake --install /home/sam/swipl-${swipl_version}/build
4244

4345

4446
FROM docker.io/debian:stable-slim

0 commit comments

Comments
 (0)