-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
81 lines (66 loc) · 2.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
# This file was auto-generated. Do not edit. See /src.
#
# Best practices for Dockerfile instructions
# https://docs.docker.com/develop/develop-images/instructions/
FROM debian:bullseye-slim
ENV FIREBIRD_RELEASE_URL=https://github.com/FirebirdSQL/firebird/releases/download/v3.0.11/Firebird-3.0.11.33703-0.amd64.tar.gz
ENV FIREBIRD_RELEASE_SHA256=713757e09b40b2631d800dacd9b80179b7eb75693a72089136055a7154413a3e
ENV FIREBIRD_VERSION=3.0.11
ENV FIREBIRD_MAJOR=3
# https://linuxcommand.org/lc3_man_pages/seth.html
# -e Exit immediately if a command exits with a non-zero status.
# -u Treat unset variables as an error when substituting
# -x Print commands and their arguments as they are executed.
# Prerequisites
# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
libatomic1 \
libicu67 \
$([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \
libtomcrypt1 \
libtommath1 \
netbase \
procps; \
rm -rf /var/lib/apt/lists/*
# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174
RUN [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/x86_64-linux-gnu/libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0 || true
# Download
ADD --checksum="sha256:$FIREBIRD_RELEASE_SHA256" \
--chown=root:root \
--chmod=777 \
$FIREBIRD_RELEASE_URL \
/tmp/firebird-bundle.tar.gz
# Extract, install, clean
RUN set -eux; \
cd /tmp; \
tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \
./install.sh -silent; \
rm *.tar.gz *.sh *.txt \
# Remove unnecessary files
rm -rf /opt/firebird/doc \
/opt/firebird/examples \
/opt/firebird/help \
/opt/firebird/include; \
# Remove 'employee' sample database from 'databases.conf'
sed -i '/^employee/d' /opt/firebird/databases.conf
# System path
ENV PATH=/opt/firebird/bin:$PATH
# Data directory
ENV FIREBIRD_DATA /run/firebird/data
RUN set -eux; \
mkdir -p "$FIREBIRD_DATA"; \
chown -R firebird:firebird "$FIREBIRD_DATA"; \
chmod 644 "$FIREBIRD_DATA"
VOLUME $FIREBIRD_DATA
# Entrypoint
COPY entrypoint.sh /usr/local/bin/
RUN set -eux; \
chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3050/tcp
# Fix terminfo location
ENV TERMINFO=/lib/terminfo/
CMD ["firebird"]