-
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/v4.0.1/Firebird-4.0.1.2692-0.amd64.tar.gz
ENV FIREBIRD_RELEASE_SHA256=90b6727b8366b3674fc30ba13d0f52ab0b419c3bb3a4224c8d3f480143538998
ENV FIREBIRD_VERSION=4.0.1
ENV FIREBIRD_MAJOR=4
# 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"]