Skip to content

Commit

Permalink
docker: fix jq/python/pip installs (#1141)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Dec 12, 2023
1 parent 7b79bbb commit 6dd0c55
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions packaging/rtx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# syntax=docker/dockerfile:1
FROM rust as builder
LABEL maintainer="jdx"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

WORKDIR /usr/src/rtx
COPY . /usr/src/rtx/
RUN cargo build --release

FROM rust as runtime

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV RTX_DATA_DIR="/rtx"
ENV RTX_CONFIG_DIR="/rtx"
ENV RTX_CACHE_DIR="/rtx/cache"
ENV PATH="/rtx/shims:$PATH"
WORKDIR /usr/src/rtx

COPY . /usr/src/rtx/
COPY --from=builder /usr/src/rtx/target/release/rtx /usr/local/bin/rtx

RUN cargo build --release \
&& ln -s /usr/bin/{python3,python} \
&& python -V \
&& apt-get update && apt-get install -y \
RUN <<EOT
set -euxo pipefail

apt-get update && apt-get install -y \
jq \
&& rm -rf /var/lib/apt/lists/* && apt-get clean
python3-pip
rm -rf /var/lib/apt/lists/* && apt-get clean

FROM rust as runtime
ln -s ./python3 /usr/bin/python

COPY --from=builder /usr/src/rtx/target/release/rtx /usr/local/bin/rtx
rtx -v
EOT

WORKDIR /rtx
ENTRYPOINT ["rtx"]
Expand Down

0 comments on commit 6dd0c55

Please sign in to comment.