~whynothugo/vdirsyncer-devel

add a containerfile to ship davcli and vdirsyncer in a container v1 PROPOSED

Antoine Beaupré: 1
 add a containerfile to ship davcli and vdirsyncer in a container

 1 files changed, 24 insertions(+), 0 deletions(-)
The point of copying the file out to a clean container is to avoid
shipping all the other stuff like cargo and friends, since we don't need
to.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~whynothugo/vdirsyncer-devel/patches/51874/mbox | git am -3
Learn more about email & git

[PATCH] add a containerfile to ship davcli and vdirsyncer in a container Export this patch

This makes it useful for me to test this without having to install a
cargo dev environment locally and provide at least some level of
isolation for code I just pull from the internet.
---
 Containerfile | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Containerfile

diff --git a/Containerfile b/Containerfile
new file mode 100644
index 0000000..2dce122
--- /dev/null
+++ b/Containerfile
@@ -0,0 +1,24 @@
FROM rust:latest AS builder

RUN useradd --home /home/user -M user -K UID_MIN=10000 -K GID_MIN=10000 && mkdir /home/user && chown user /home/user && chmod 0770 /home/user

USER user

WORKDIR /home/user

COPY --chown=user . /home/user/vdirsyncer-rs

RUN cd /home/user/vdirsyncer-rs && cargo build

FROM debian:stable-slim

RUN useradd --home /home/user -M user -K UID_MIN=10000 -K GID_MIN=10000 && mkdir /home/user && chown user /home/user && chmod 0770 /home/user && apt update && apt upgrade -y && apt install -y libsqlite3-0 libgcc-s1 && apt clean && rm -rf /var/lib/apt/lists/*

USER user

WORKDIR /home/user

COPY --from=builder /home/user/vdirsyncer-rs/target/debug/davcli /usr/local/bin/
COPY --from=builder /home/user/vdirsyncer-rs/target/debug/vdirsyncer /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/vdirsyncer"]
-- 
2.39.2