Add Containerfile
This commit is contained in:
parent
aea0620747
commit
57254b3eb0
9
Containerfile
Normal file
9
Containerfile
Normal 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"]
|
10
Makefile
10
Makefile
|
@ -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
|
Loading…
Reference in a new issue