add Containerfile

This commit is contained in:
surtur 2022-09-14 10:58:26 +02:00
parent fa2b8ecd77
commit d032783f5e
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI
2 changed files with 23 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
.git

22
Containerfile Normal file
View File

@ -0,0 +1,22 @@
# syntax=docker/dockerfile-upstream:master-labs
FROM docker.io/library/golang:1.19.1-alpine3.16 AS diwtbuild
WORKDIR /diwt
COPY . .
RUN CGO_ENABLED=0 GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" \
go build -v -ldflags '-s -w' .
FROM docker.io/library/alpine:3.16.2
ARG VCS_REF
COPY --from=diwtbuild /diwt/diwt /usr/bin/diwt
# have a default.
# this would, of course, require mounting a file to the following location.
CMD ["/usr/bin/diwt", "-m", "/matrix.txt"]
# vim: set ts=4 ft=dockerfile fenc=utf-8 ff=unix :