Skip to content

Commit

Permalink
build: Change base Docker image from Alpine to Debian (#2348)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksraiden authored Jun 3, 2024
1 parent 309ea7b commit 5744d1b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,29 @@
# specific language governing permissions and limitations
# under the License.

FROM alpine:3.16 as build
FROM debian:bookworm-slim AS build

ARG MORE_BUILD_ARGS

RUN apk update && apk upgrade && apk add git gcc g++ make cmake ninja autoconf automake libtool python3 linux-headers curl openssl-dev libexecinfo-dev redis
RUN DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get upgrade -y && apt-get -y --no-install-recommends install git build-essential autoconf cmake libtool python3 libssl-dev && apt-get autoremove && apt-get clean

WORKDIR /kvrocks

COPY . .
RUN ./x.py build -DENABLE_OPENSSL=ON -DPORTABLE=1 -DCMAKE_BUILD_TYPE=Release -j $(nproc) $MORE_BUILD_ARGS

FROM alpine:3.16
FROM debian:bookworm-slim

RUN DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get upgrade -y && apt-get -y install openssl ca-certificates redis-tools && apt-get clean

RUN apk update && apk upgrade && apk add libexecinfo
RUN mkdir /var/run/kvrocks

VOLUME /var/lib/kvrocks

COPY --from=build /kvrocks/build/kvrocks /bin/
COPY --from=build /usr/bin/redis-cli /bin/

HEALTHCHECK --interval=10s --timeout=1s --start-period=30s --retries=3 \
CMD ./bin/redis-cli -p 6666 PING | grep -E '(PONG|NOAUTH)' || exit 1
CMD redis-cli -p 6666 PING | grep -E '(PONG|NOAUTH)' || exit 1

COPY ./LICENSE ./NOTICE ./licenses /kvrocks/
COPY ./kvrocks.conf /var/lib/kvrocks/
Expand Down

0 comments on commit 5744d1b

Please sign in to comment.