server: Add Containerfile
The SSHCA server is intended to be run in a Kubernetes container.master
parent
a0f6119d60
commit
be4f5eb6d7
|
@ -0,0 +1,5 @@
|
|||
*
|
||||
!src/
|
||||
!examples/
|
||||
!Cargo.toml
|
||||
!Cargo.lock
|
|
@ -0,0 +1,29 @@
|
|||
FROM registry.fedoraproject.org/fedora:38 AS build
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache \
|
||||
dnf install -y \
|
||||
--setopt install_weak_deps=0 \
|
||||
cargo \
|
||||
libvirt-devel \
|
||||
rust \
|
||||
&& :
|
||||
|
||||
COPY . /build
|
||||
|
||||
RUN cd /build && cargo build --release --bins && strip -s target/release/sshca
|
||||
|
||||
FROM registry.fedoraproject.org/fedora-minimal:38
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache \
|
||||
microdnf install -y \
|
||||
--setopt install_weak_deps=0 \
|
||||
tini \
|
||||
libvirt-libs \
|
||||
openssh-clients \
|
||||
&& :
|
||||
|
||||
COPY --from=build /build/target/release/sshca /usr/local/bin/sshca
|
||||
|
||||
USER 298:298
|
||||
|
||||
ENTRYPOINT ["tini", "/usr/local/bin/sshca", "--"]
|
Loading…
Reference in New Issue