I'm building a base pants docker image. How can i ...
# general
d
I'm building a base pants docker image. How can i add pants version 2.20.1 in this docker image i have installed the pants binary.
Copy code
ARG BASE_IMAGE     
ARG BASE_IMAGE_TAG
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG}

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    bash \
    curl \ 
    coreutils && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY get-pants.sh .
RUN chmod +x ./get-pants.sh
RUN /bin/bash -c ./get-pants.sh
ENV PATH=/root/.local/bin:${PATH}
b
The way i am doing is, directly download in the image itself, by running
Copy code
RUN curl --proto '=https' --tlsv1.2 -fsSL <https://static.pantsbuild.org/setup/get-pants.sh> | bash
ENV PATH="/root/.local/bin:${PATH}"
d
But it only install the binary
b
You’ll need to execute the binary with the relevant pants version. For instance,
PANTS_VERSION=2.20.1 pants version
potentially. I don’t remember if you need to have a
pants.toml
file available (if so, create an empty one and then delete it, in the run step)