zenoh-exp/k8s/Dockerfile

22 lines
901 B
Docker

FROM registry.fedoraproject.org/fedora:latest AS builder
# You must mount the source directory when building. I.E.:
# podman build --no-cache -v $PWD:/src -f k8s/Dockerfile -t zenoh-k3s-registry:5000/zenoh-exp .
# TODO: Cache the deps piece by making a custom base image. Mounting a volume does not
# play nice with caching.
# Dependencies
RUN sudo dnf update -y && \
sudo dnf install -y git curl gcc-c++ openssl-devel
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.75.0
RUN cd /src && \
/bin/bash -c "source $HOME/.cargo/env && cargo build --release" && \
mkdir /app && \
find ./target/release -maxdepth 1 -type f -perm /a+x -not -name "*.so" -not -name "*.rlib" -exec cp {} /app \;
FROM registry.fedoraproject.org/fedora:latest
COPY --from=builder /app/* /usr/local/bin/.
RUN useradd -m -s /bin/bash -u 1000 zenoh
USER zenoh
ENTRYPOINT ["/bin/bash", "-c"]