Skip to content

Commit

Permalink
fix: fix examples docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
zzlk committed Jul 12, 2023
1 parent 4bdd556 commit 39b43cd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ FROM --platform=$BUILDPLATFORM rust:slim-buster AS build

ARG TARGETOS TARGETARCH

RUN apt-get update && apt-get install -y git
RUN apt-get update && apt-get install -y pkg-config
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
pkg-config \
python3

RUN /bin/bash -c "if [ "${TARGETARCH}" == "arm64" ]; then apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu ; else apt-get install -y gcc-x86-64-linux-gnu g++-x86-64-linux-gnu ; fi"

Expand All @@ -21,7 +23,12 @@ RUN mkdir -p xfer/example_utils && cp hydroflow/example_utils/* xfer/example_uti
# Runtime stage
FROM rust:slim-buster

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

WORKDIR /usr/src/myapp
COPY --from=build /usr/src/myapp/xfer/examples/* .
Expand Down

0 comments on commit 39b43cd

Please sign in to comment.