Add container image build script

This commit is contained in:
2025-11-20 09:41:48 -06:00
parent f43ac14e2a
commit 1855fac18d
2 changed files with 35 additions and 0 deletions

4
.containerignore Normal file
View File

@@ -0,0 +1,4 @@
*
!src
!Cargo.lock
!Cargo.toml

31
Containerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM docker.io/library/alpine AS build
RUN --mount=type=cache,target=/var/cache/apk <<EOS
xargs apk add <<PKGS
cargo
libc-dev
openssl
openssl-dev
rust
PKGS
EOS
WORKDIR /src
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry <<EOS
set -e
cargo build --release
cp target/release/updatecheck /updatecheck
strip /updatecheck
EOS
FROM docker.io/library/alpine
RUN --mount=type=cache,target=/var/cache/apk apk add libgcc openssl
COPY --from=build /updatecheck /usr/local/bin
ENTRYPOINT ["updatecheck"]