Skip to content

Commit

Permalink
build image to rust:1.72
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Sep 22, 2023
1 parent eba1638 commit f83006a
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,10 @@
# Build Stage
# ------------------------------------------------------------------------------

FROM registry.access.redhat.com/ubi8/ubi:8.7 as limitador-build
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
FROM rust:1.72 as limitador-build

ARG RUSTC_VERSION=1.72.0

# the powertools repo is required for protobuf-c and protobuf-devel
RUN dnf -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs install \
http://mirror.centos.org/centos/8-stream/BaseOS/`arch`/os/Packages/centos-gpg-keys-8-6.el8.noarch.rpm \
http://mirror.centos.org/centos/8-stream/BaseOS/`arch`/os/Packages/centos-stream-repos-8-6.el8.noarch.rpm \
&& dnf -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs install epel-release \
&& dnf config-manager --set-enabled powertools

RUN PKGS="gcc-c++ gcc-toolset-12-binutils-gold openssl-devel protobuf-c protobuf-devel git clang kernel-headers" \
&& dnf install --nodocs --assumeyes $PKGS \
&& rpm --verify --nogroup --nouser $PKGS \
&& yum -y clean all

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --profile minimal --default-toolchain ${RUSTC_VERSION} -c rustfmt -y
RUN apt update && apt upgrade -y
RUN apt install -y protobuf-compiler clang

WORKDIR /usr/src/limitador

Expand All @@ -29,8 +15,7 @@ ENV RUSTFLAGS="-C target-feature=-crt-static"

COPY . .

RUN source $HOME/.cargo/env \
&& cargo build --release
RUN cargo build --release

# ------------------------------------------------------------------------------
# Run Stage
Expand Down

0 comments on commit f83006a

Please sign in to comment.