Skip to content

Commit e961566

Browse files
committed
Added Dockerfile (#1)
Reviewed-on: http://bit:3000/yuce/pyswip/pulls/1 Co-authored-by: Yuce Tekol <yucetekol@gmail.com> Co-committed-by: Yuce Tekol <yucetekol@gmail.com>
1 parent febd9c9 commit e961566

File tree

4 files changed

+80
-1
lines changed

4 files changed

+80
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
.PHONY: build clean coverage upload-coverage test upload
1+
.PHONY: build clean coverage upload-coverage test upload docker
2+
3+
DOCKER ?= docker
24

35
build:
46
pyproject-build
@@ -24,3 +26,6 @@ check:
2426

2527
reformat:
2628
ruff format
29+
30+
docker:
31+
$(DOCKER) build -t quay.io/ytekol/pyswip:latest -f docker/Dockerfile .

docker/Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM docker.io/debian:stable-slim AS build
2+
3+
RUN useradd -m sam
4+
5+
RUN \
6+
apt-get update && \
7+
apt-get upgrade -y && \
8+
apt-get install -y \
9+
curl \
10+
build-essential cmake ninja-build pkg-config \
11+
ncurses-dev libedit-dev \
12+
libgoogle-perftools-dev \
13+
libgmp-dev \
14+
libssl-dev \
15+
unixodbc-dev \
16+
zlib1g-dev libarchive-dev \
17+
libossp-uuid-dev \
18+
libdb-dev \
19+
libpcre2-dev \
20+
libyaml-dev
21+
22+
WORKDIR /home/sam
23+
USER sam
24+
25+
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 && \
29+
cmake \
30+
-B build \
31+
-G Ninja \
32+
-DINSTALL_DOCUMENTATION=OFF \
33+
-DBUILD_TESTING=OFF \
34+
-DCMAKE_INSTALL_PREFIX=/usr/lib/swi-prolog \
35+
-DCMAKE_BUILD_TYPE=PGO && \
36+
cmake --build build
37+
38+
USER root
39+
40+
RUN \
41+
cmake --install /home/sam/swipl-10.0.0/build
42+
43+
44+
FROM docker.io/debian:stable-slim
45+
LABEL authors="Yuce Tekol"
46+
47+
RUN useradd -m sam
48+
49+
COPY --from=build /usr/lib/swi-prolog /usr/lib/swi-prolog
50+
51+
RUN \
52+
ln -s /usr/lib/swi-prolog/bin/swipl /bin/swipl
53+
54+
RUN \
55+
apt-get update && \
56+
apt-get upgrade -y && \
57+
apt-get install -y \
58+
libtcmalloc-minimal4t64 \
59+
python3
60+
61+
COPY ./docker/etc/update-motd.d/10-help-text /etc/update-motd.d/10-help-text
62+
COPY ./docker/etc/update-motd.d/50-motd-news /etc/update-motd.d/50-motd-news
63+
COPY ./src/pyswip /usr/lib/python3.13/pyswip
64+
65+
WORKDIR /home/sam
66+
USER sam
67+
68+
ENTRYPOINT ["python3"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# help-text
2+
3+
Nothing here, yet.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# motd-news
2+
3+
Nothing here, yet.

0 commit comments

Comments
 (0)