diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d74051d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.21.6-alpine + +RUN apk add --update --no-cache build-base make bash git && rm -rf /var/cache/apk/* +RUN mkdir -p /go/src/app +RUN git config --global --add safe.directory /go/src/app +VOLUME /go/src/app +WORKDIR /go/src/app + diff --git a/Makefile b/Makefile index 2d88333..3625ebe 100644 --- a/Makefile +++ b/Makefile @@ -205,3 +205,7 @@ version: sed -i -e 's/VERSION =.*/VERSION = "'$$NEWVERSION'"/g' cmd/*/*.go pkg/checknscweb/*.go check_nsc_web: build + +docker: + docker build -t dockerbuilder . + docker run -it --rm -e CGO_ENABLED=1 -v $(shell pwd):/go/src/app dockerbuilder make $(target) diff --git a/README.md b/README.md index 32e7578..6275abc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,18 @@ To be easily portable, *check_nsc_web* is written in Go. *check_nsc_web* is released under the GNU GPL v3. +## Building the binaries + +### With docker + +``` +make docker +``` +or to select a specific makefile target +``` +make docker target=citest +``` + ## Usage examples * Alive check ```