warrenfalk / rocksdb-sharp

.net bindings for the rocksdb by facebook
Other
206 stars 65 forks source link

Support for Docker containers #58

Closed angshuman closed 4 years ago

angshuman commented 5 years ago

Have you considered supporting docker containers officially? I came across a few issues while running rocksdb-sharp in a container.

  1. Libdl not found. This is not included by default in the microsoft/dotnet base container. So I had to use the following commands to install

RUN apt-get update && apt-get install -y libcap2-bin libsnappy1v5 && \ ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so && \ ln -s /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc.so && \ rm -rf /var/lib/apt/lists/*

  1. Even after this I get the following exception when calling RocksDb.Open

RocksDbSharp.RocksDbException HResult=0x80131500 Message=IO error: While fsync: a directory: Invalid argument Source=RocksDbSharp StackTrace: at RocksDbSharp.Native.rocksdb_open(IntPtr options, String name) at RocksDbSharp.RocksDb.Open(OptionsHandle options, String path) at Hexastore.Rocks.RocksTest..ctor()

promontis commented 5 years ago

@angshuman this worked for me:

RUN apt-get update && apt-get install -y --no-install-recommends libc6-dev libsnappy1v5
angshuman commented 4 years ago

Update: I have to put the following apt-get in the Dockerfile

RUN apt-get update && apt-get install -y libcap2-bin libsnappy1v5 && \
    ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so && \
    ln -s /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc.so && \
    rm -rf /var/lib/apt/lists/*