Add Containerfile

This commit is contained in:
Felix Niederwanger 2023-05-31 19:36:57 +02:00
parent aea0620747
commit 57254b3eb0
Signed by: phoenix
GPG key ID: 6E77A590E3F6D71C
2 changed files with 19 additions and 0 deletions

9
Containerfile Normal file
View file

@ -0,0 +1,9 @@
FROM registry.suse.com/bci/golang AS build-env
WORKDIR /app
COPY . /app
RUN cd /app && make requirements && make smartbridge-static
FROM scratch
WORKDIR /data
COPY --from=build-env /app/smartbridge /
ENTRYPOINT ["/smartbridge", "/conf/smartbridge.yml"]

View file

@ -1,5 +1,15 @@
default: all
all: smartbridge
requirements:
go mod download
smartbridge: cmd/smartbridge/*.go
go build -o $@ $^
smartbridge-static: cmd/smartbridge/*.go
CGO_ENABLED=0 go build -ldflags="-w -s" -o smartbridge $^
.PHONY: container
container: cmd/smartbridge/*.go
podman build . -t feldspaten.org/smartbridge