Skip to content

Commit

Permalink
alpine: use CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 28, 2024
1 parent b0bdb64 commit 96fa74c
Showing 1 changed file with 64 additions and 24 deletions.
88 changes: 64 additions & 24 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,78 @@
FROM alpine:3.20

RUN apk --no-cache add \
ca-certificates \
curl \
g++ \
libevent \
make \
msgpack-c-dev \
musl-dev \
zeromq && \
update-ca-certificates
RUN \
apk --no-cache add \
apache-arrow-dev \
bash \
bison \
blosc-dev \
bsd-compat-headers \
ca-certificates \
cmake \
curl \
g++ \
gcc \
gdb \
git \
libedit-dev \
libevent-dev \
libstemmer-dev \
lz4-dev \
make \
msgpack-c-dev \
musl-dev \
openssl-dev \
pkgconf \
rapidjson-dev \
ruby-dev \
samurai \
# simdjson-dev \
sudo \
tzdata \
xsimd-dev \
xxhash-dev \
zeromq-dev \
zlib-dev \
zstd-dev && \
update-ca-certificates

WORKDIR /usr/local/src

ENV CFLAGS -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security
ENV LDFLAGS -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now
ENV CPPFLAGS -Wdate-time -D_FORTIFY_SOURCE=2
ENV CXXFLAGS -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security
ENV GROONGA_VERSION=14.0.9

RUN \
curl -Lo groonga.tar.gz \
https://packages.groonga.org/source/groonga/groonga-$GROONGA_VERSION.tar.gz && \
https://packages.groonga.org/source/groonga/groonga-${GROONGA_VERSION}.tar.gz && \
tar xzf groonga.tar.gz && \
cd groonga-$GROONGA_VERSION && \
./configure \
--disable-dependency-tracking \
--disable-groonga-httpd \
--disable-maintainer-mode \
--prefix=/usr && \
make -j$(nproc) && \
make DESTDIR=/chroot install
cmake \
-Sgroonga-${GROONGA_VERSION} \
-Bgroonga-${GROONGA_VERSION}.build \
--preset=release-maximum \
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_SYSCONFDIR=/etc && \
cmake --build groonga-${GROONGA_VERSION}.build && \
DESTDIR=/chroot cmake --install groonga-${GROONGA_VERSION}.build && \
rm -rf \
/chroot/usr/include \
/chroot/usr/lib/cmake \
/chroot/usr/lib/pkgconfig

FROM alpine:3.20
RUN apk --no-cache add zeromq libevent msgpack-c
RUN \
apk --no-cache add \
blosc \
libarrow \
libedit \
libevent \
libstemmer \
lz4 \
msgpack-c \
openssl \
xsimd \
xxhash-dev \
zeromq \
zlib \
zstd
COPY --from=0 /chroot/ /
ENTRYPOINT ["groonga"]

0 comments on commit 96fa74c

Please sign in to comment.