Skip to content

Commit b369411

Browse files
authored
feat: setup jemalloc page size to 64k on arm (OT-CONTAINER-KIT#72)
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
1 parent 5f7751f commit b369411

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ RUN curl -fL -Lo redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${RED
2121

2222
WORKDIR /tmp/redis-${REDIS_VERSION}
2323

24-
RUN make && \
25-
make install BUILD_TLS=yes
24+
RUN arch="$(uname -m)"; \
25+
extraJemallocConfigureFlags="--with-lg-page=16"; \
26+
if [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]; then \
27+
sed -ri 's!cd jemalloc && ./configure !&'"$extraJemallocConfigureFlags"' !' /tmp/redis-${REDIS_VERSION}/deps/Makefile; \
28+
fi; \
29+
export BUILD_TLS=yes; \
30+
make all; \
31+
make install
2632

2733
FROM alpine:3.15
2834

Dockerfile.sentinel

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ WORKDIR /tmp
1616

1717
RUN curl -fL -Lo redis-${REDIS_SENTINEL_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_SENTINEL_VERSION}.tar.gz && \
1818
tar xvzf redis-${REDIS_SENTINEL_VERSION}.tar.gz && \
19-
make -C redis-${REDIS_SENTINEL_VERSION} && \
20-
make -C redis-${REDIS_SENTINEL_VERSION} install BUILD_TLS=yes
19+
arch="$(uname -m)"; \
20+
extraJemallocConfigureFlags="--with-lg-page=16"; \
21+
if [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]; then \
22+
sed -ri 's!cd jemalloc && ./configure !&'"$extraJemallocConfigureFlags"' !' /tmp/redis-${REDIS_SENTINEL_VERSION}/deps/Makefile; \
23+
fi; \
24+
export BUILD_TLS=yes; \
25+
make -C redis-${REDIS_SENTINEL_VERSION} all; \
26+
make -C redis-${REDIS_SENTINEL_VERSION} install
2127

2228
FROM alpine:3.15
2329

0 commit comments

Comments
 (0)