From cefafaee826623e2dac19fa1b40ef15bd54cdc85 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Sun, 14 Jan 2024 20:11:08 +0000 Subject: [PATCH] chore(jetp): build jetp in an separate stage Create a multi-stage build to compile jetporch and copy the binary to nvim image. --- Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index c4883cd..b69afee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,12 @@ +FROM ubuntu:22.04 as jetporch-builder +ENV PATH /root/.cargo/bin:${PATH} +RUN apt-get update \ + && apt-get install -y build-essential curl git libssl-dev pkg-config \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && git clone https://git.sr.ht/~mpdehaan/jetporch /tmp/jetporch \ + && cd /tmp/jetporch \ + && make + FROM ubuntu:22.04 # system deps @@ -143,12 +152,10 @@ RUN git clone https://github.com/elixir-lsp/elixir-ls.git ${LOCAL_SRC_HOME}/elix # command line utilities RUN curl https://mise.jdx.dev/install.sh | sh \ && curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash \ - && git clone https://github.com/tmux-plugins/tpm.git ${XDG_CONFIG_HOME}/tmux/plugins/tpm \ - && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ - && git clone https://git.sr.ht/~mpdehaan/jetporch ${LOCAL_SRC_HOME}/jetporch \ - && cd ${LOCAL_SRC_HOME}/jetporch \ - && make \ - && ln -s ${LOCAL_SRC_HOME}/jetporch/target/release/jetp ${LOCAL_BIN_HOME}/ + && git clone https://github.com/tmux-plugins/tpm.git ${XDG_CONFIG_HOME}/tmux/plugins/tpm + +# fetch jetporch from builder step +COPY --from=jetporch-builder --chown=coder:coder /tmp/jetporch/target/release/jetp ${LOCAL_BIN_HOME} # configure fish and bash RUN fish -c true \