Add container image build script
This commit is contained in:
4
.containerignore
Normal file
4
.containerignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
*
|
||||||
|
!src
|
||||||
|
!Cargo.lock
|
||||||
|
!Cargo.toml
|
||||||
31
Containerfile
Normal file
31
Containerfile
Normal 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"]
|
||||||
Reference in New Issue
Block a user