# syntax=docker/dockerfile:1.3

# Copyright (c) 2023 by Alibaba.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

FROM openanolis/anolisos:latest as builder

WORKDIR /usr/src/rvps

COPY . .

RUN yum update -y && yum install -y curl git openssh protobuf-compiler make gcc openssl openssl-devel clang

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup component add rustfmt clippy

RUN cargo install --bin rvps --path rvps

FROM openanolis/anolisos:latest

RUN yum install -y openssl curl

COPY --from=builder /root/.cargo/bin/rvps /usr/local/bin/rvps

CMD ["rvps"]

VOLUME /opt/confidential-containers/attestation-service/reference_values/

EXPOSE 50003