chore(lander): fix Docker build

lsm
Jef Roosens 2023-11-14 15:34:07 +01:00
parent 6af3e6ad6d
commit 29f4edc059
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
4 changed files with 29 additions and 19 deletions

View File

@ -1,4 +1,15 @@
data/
build/
trie/build/
.git/
*
!src/
!include/
!lsm/src/
!lsm/include/
!lsm/Makefile
!lsm/config.mk
!thirdparty/include
!thirdparty/src
!Makefile
!config.mk

View File

@ -1,11 +1,12 @@
FROM alpine:3.18.0 AS builder
FROM ubuntu:23.10 AS builder
ARG DI_VER=1.2.5
RUN apk add --update --no-cache \
build-base \
make \
curl
RUN apt update && \
apt install -y --no-install-recommends \
curl ca-certificates \
build-essential \
musl musl-dev musl-tools
WORKDIR /app
@ -18,7 +19,7 @@ RUN curl -Lo - "https://github.com/Yelp/dumb-init/archive/refs/tags/v${DI_VER}.t
COPY . ./
RUN make CFLAGS='-O3' LDFLAGS='-static -flto' && \
RUN make CFLAGS='-O3' LDFLAGS='-flto -static' && \
strip build/lander && \
readelf -d build/lander && \
[ "$(readelf -d build/lander | grep NEEDED | wc -l)" = 0 ]

View File

@ -35,15 +35,11 @@ all: $(BIN)
.PHONY: objs
objs: $(OBJS)
.PHONY: libtrie
libtrie:
$(MAKE) -C trie
.PHONY: liblsm
liblsm:
$(MAKE) -C lsm
$(BIN): libtrie liblsm $(OBJS)
$(BIN): liblsm $(OBJS)
$(CC) -o $@ $(OBJS) $(_LDFLAGS)
$(BUILD_DIR)/$(SRC_DIR)/%.c.o: $(SRC_DIR)/%.c
@ -126,12 +122,14 @@ check:
--enable=warning,style \
-ithirdparty/* \
-itrie/* \
--quiet
--inline-suppr \
--check-level=exhaustive \
--quiet \
-j$(shell nproc)
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
$(MAKE) -C trie clean
$(MAKE) -C lsm clean

View File

@ -8,8 +8,8 @@ TEST_DIR = test
THIRDPARTY_DIR = thirdparty
INC_DIRS = include $(THIRDPARTY_DIR)/include trie/include lsm/include
LIBS = trie m lsm
LIB_DIRS = ./trie/build ./lsm/build
LIBS = m lsm
LIB_DIRS = ./lsm/build
# -MMD: generate a .d file for every source file. This file can be imported by
# make and makes make aware that a header file has been changed, ensuring an