Skip to content

Commit

Permalink
Add dockerfile and documentation (#51)
Browse files Browse the repository at this point in the history
* Change CMakeLists cmake version minimum from 3.2 to 3.0, for dockerize the setup.

* Add Dockerfile initial version to accelerate setup. Need more refine such as password and port options, etc.al

* Update pull request to include documentation
  • Loading branch information
aviggiano committed Feb 5, 2018
1 parent 8d37d46 commit f5db009
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -6,8 +6,8 @@ before_install:

install:
- sudo apt-get update
- cd /tmp && wget ftp://sourceware.org/pub/valgrind/valgrind-3.13.0.tar.bz2 && tar -xjf valgrind-3.13.0.tar.bz2 && cd valgrind-3.13.0 && ./configure --prefix=/usr/local && make && sudo make install && ccache --clear && cd - && valgrind --version
- sudo apt-get install libc6-dbg
- CURDIR=$(pwd) && cd /tmp && wget ftp://sourceware.org/pub/valgrind/valgrind-3.13.0.tar.bz2 && tar -xjf valgrind-3.13.0.tar.bz2 && cd valgrind-3.13.0 && ./configure --prefix=/usr/local && make && sudo make install && ccache --clear && valgrind --version && cd $CURDIR
- sudo apt-get install -y libc6-dbg

compiler:
- clang
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.0)
project(redis-roaring)

set(CMAKE_VERBOSE_MAKEFILE on)
Expand Down
32 changes: 32 additions & 0 deletions Dockerfile
@@ -0,0 +1,32 @@
FROM redis

ENV ROARING_REDIS_GIT_URL https://github.com/aviggiano/redis-roaring.git
RUN set -ex; \
\
BUILD_DEPS=' \
ca-certificates \
cmake \
gcc \
git \
g++ \
make \
'; \
apt-get update; \
apt-get install -y $BUILD_DEPS --no-install-recommends; \
rm -rf /var/lib/apt/lists/*; \
git clone "$ROARING_REDIS_GIT_URL"; \
cd redis-roaring; \
bash configure.sh; \
mkdir -p build; \
cd build; \
cmake ..; \
make -j; \
cp libredis-roaring.so /usr/local/lib/; \
\
apt-get purge -y --auto-remove $BUILD_DEPS
ADD http://download.redis.io/redis-stable/redis.conf /usr/local/etc/redis/redis.conf
RUN sed -i '1i loadmodule /usr/local/lib/libredis-roaring.so' /usr/local/etc/redis/redis.conf; \
chmod 644 /usr/local/etc/redis/redis.conf; \
sed -i 's/^bind 127.0.0.1/#bind 127.0.0.1/g' /usr/local/etc/redis/redis.conf; \
sed -i 's/^protected-mode yes/protected-mode no/g' /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -48,6 +48,15 @@ cmake ..
make
```

## Docker

It is also possible to run this project as a docker container:

```bash
docker build -t redis-roaring
docker run -p 6379:6379 redis-roaring:latest
```

## Tests

Run the `test.sh` script for unit tests, integration tests and performance tests.
Expand Down

0 comments on commit f5db009

Please sign in to comment.