From 5fdf287c4d6a9ddc8a9caf3447cd27575c13a24c Mon Sep 17 00:00:00 2001 From: "Matthew (mbg)" Date: Fri, 29 Mar 2024 11:08:34 -0700 Subject: [PATCH] dev: add dockerfile for local dev (#172) There have been some comments about wanting an easier developer experience, particularly on MacOS. This adds a Dockerfile which will create an environment in which all tests can pass and will hopefully make cross-platform development easier. Solves #91 --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0fb9ce9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM debian:latest as builder + +ARG BUILDARCH +RUN apt-get -qq update \ + && apt-get -qq install -y --no-install-recommends \ + gcc g++ libfindbin-libs-perl \ + make cmake libclang-dev git \ + wget curl gnupg ca-certificates lsb-release \ + && wget --no-check-certificate -O - https://openresty.org/package/pubkey.gpg | gpg --dearmor -o /usr/share/keyrings/openresty.gpg \ + && if [ "${BUILDARCH}" = "arm64" ]; then URL="http://openresty.org/package/arm64/debian"; else URL="http://openresty.org/package/debian"; fi \ + && echo "deb [arch=$BUILDARCH signed-by=/usr/share/keyrings/openresty.gpg] ${URL} $(lsb_release -sc) openresty" | tee /etc/apt/sources.list.d/openresty.list > /dev/null \ + && apt-get -qq update \ + && apt-get -qq install -y openresty --no-install-recommends + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +WORKDIR /var/opt/pingora +COPY . . +RUN cargo build