-
Notifications
You must be signed in to change notification settings - Fork 37
/
Dockerfile-debian
151 lines (144 loc) · 5.38 KB
/
Dockerfile-debian
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#################################################################
# #
# Copyright (c) 2018-2024 YottaDB LLC and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
# See README.md for more information about this Dockerfile
# Simple build/running directions are below:
#
# Build:
# $ docker build -t yottadb/yottadb:latest -f Dockerfile-debian .
#
# Use with data persistence:
# $ docker run -p 1337:1337 -p 9080:9080 --rm -v `pwd`/ydb-data:/data -ti yottadb/yottadb:latest
ARG OS_VSN=bullseye
# Stage 1: YottaDB build image
FROM debian:${OS_VSN} as ydb-release-builder
ARG CMAKE_BUILD_TYPE=Release
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
file \
cmake \
make \
gcc \
pkg-config \
git \
tcsh \
gawk \
libconfig-dev \
libelf-dev \
libicu-dev \
libncurses-dev \
libreadline-dev \
libssl-dev \
libgcrypt-dev \
&& \
apt-get clean
RUN mkdir /tmp/yottadb-src
ADD CMakeLists.txt /tmp/yottadb-src
# We want to copy the directories themselves, not their contents.
# Unfortunately, there is no way to do this with globs, so we have to specify each directory individually.
# c.f. <https://docs.docker.com/engine/reference/builder/#add>, <https://stackoverflow.com/questions/26504846>
ADD cmake /tmp/yottadb-src/cmake
ADD sr_aarch64 /tmp/yottadb-src/sr_aarch64
ADD sr_armv7l /tmp/yottadb-src/sr_armv7l
ADD sr_i386 /tmp/yottadb-src/sr_i386
ADD sr_linux /tmp/yottadb-src/sr_linux
ADD sr_port /tmp/yottadb-src/sr_port
ADD sr_port_cm /tmp/yottadb-src/sr_port_cm
ADD sr_unix /tmp/yottadb-src/sr_unix
ADD sr_unix_cm /tmp/yottadb-src/sr_unix_cm
ADD sr_unix_gnp /tmp/yottadb-src/sr_unix_gnp
ADD sr_unix_nsb /tmp/yottadb-src/sr_unix_nsb
ADD sr_x86_64 /tmp/yottadb-src/sr_x86_64
ADD sr_x86_regs /tmp/yottadb-src/sr_x86_regs
ADD .git /tmp/yottadb-src/.git
ENV GIT_DIR=/tmp/yottadb-src/.git
RUN mkdir -p /tmp/yottadb-build \
&& cd /tmp/yottadb-build \
&& test -f /tmp/yottadb-src/.yottadb.vsn || \
grep YDB_ZYRELEASE /tmp/yottadb-src/sr_*/release_name.h \
| grep -o '\(r[0-9.]*\)' \
| sort -u \
> /tmp/yottadb-src/.yottadb.vsn \
&& cmake \
-D CMAKE_INSTALL_PREFIX:PATH=/tmp \
-D YDB_INSTALL_DIR:STRING=yottadb-release \
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
/tmp/yottadb-src \
&& make -j $(nproc) \
&& make install
# Stage 2: YottaDB release image
FROM debian:${OS_VSN} as ydb-release
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
file \
binutils \
ca-certificates \
libelf-dev \
libicu-dev \
locales \
wget \
netbase \
vim \
procps \
make \
golang \
git \
pkg-config \
clang \
python3-dev \
python3-setuptools \
libffi-dev \
python3-pip \
npm \
g++ \
lua5.4 \
liblua5.4-dev \
build-essential \
cmake \
bison \
flex \
xxd \
libreadline-dev \
libssl-dev \
curl \
libcurl4-openssl-dev \
libconfig-dev \
whois \
&& \
apt-get clean
RUN locale-gen en_US.UTF-8
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
WORKDIR /data
COPY --from=ydb-release-builder /tmp/yottadb-release /tmp/yottadb-release
RUN cd /tmp/yottadb-release \
&& ./ydbinstall \
--utf8 \
--installdir /opt/yottadb/current \
--octo \
--gui \
&& rm -rf /tmp/yottadb-release
ENV ydb_dir=/data \
LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=C.UTF-8 \
ydb_chset=UTF-8 \
GOPATH=$HOME/go \
GOPROXY=https://proxy.golang.org/cached-only \
ydb_dist=/opt/yottadb/current
RUN go version && go get -t -d lang.yottadb.com/go/yottadb && cd $GOPATH/src/lang.yottadb.com/go/yottadb && git checkout develop
RUN git clone https://github.com/anet-be/lua-yottadb.git && cd lua-yottadb && make install && cd - && rm -rf lua-yottadb
RUN . /opt/yottadb/current/ydb_env_set && git clone https://gitlab.com/oesiman/yottadb-perl.git && cd yottadb-perl && perl Makefile.PL && make test TEST_DB=1 && make install && cd - && rm -rf yottadb-perl
RUN git clone https://gitlab.com/YottaDB/Lang/YDBPython.git && cd YDBPython && python3 setup.py install --user && cd - && rm -rf YDBPython
COPY ci/docker-scripts/docker-debian-startup.sh /docker-debian-startup.sh
EXPOSE 1337 9080
ENTRYPOINT ["/docker-debian-startup.sh"]