Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make docker image more portable #1233

Merged
merged 2 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option(USE_LUAJIT "use luaJIT instead of lua" OFF)
option(ENABLE_OPENSSL "enable openssl to support tls connection" OFF)
option(ENABLE_IPO "enable interprocedural optimization" ON)
option(ENABLE_UNWIND "enable libunwind in glog" ON)
option(PORTABLE "build a portable binary (disable arch-specific optimizations)" OFF)

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@

FROM ubuntu:focal as build

ARG MORE_BUILD_ARGS

# workaround tzdata install hanging
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt update
RUN apt install -y git gcc g++ make cmake autoconf automake libtool python3 libssl-dev
RUN apt update && apt install -y git gcc g++ make cmake autoconf automake libtool python3 libssl-dev
WORKDIR /kvrocks

COPY . .
RUN ./x.py build -DENABLE_OPENSSL=ON
RUN ./x.py build -DENABLE_OPENSSL=ON -DPORTABLE=ON $MORE_BUILD_ARGS

FROM ubuntu:focal

Expand Down
1 change: 1 addition & 0 deletions cmake/rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ FetchContent_MakeAvailableWithArgs(rocksdb
USE_RTTI=ON
ROCKSDB_BUILD_SHARED=OFF
WITH_JEMALLOC=${COMPILE_WITH_JEMALLOC}
PORTABLE=${PORTABLE}
)

add_library(rocksdb_with_headers INTERFACE)
Expand Down