diff --git a/Makefile b/Makefile index 62553326c4..13b13c4dc4 100644 --- a/Makefile +++ b/Makefile @@ -98,9 +98,9 @@ ci: build-ci test lint-ci # to be run in Docker build build-revad-docker: off - go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad + env CGO_ENABLED=0 go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad build-reva-docker: off - go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva + env CGO_ENABLED=0 go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva clean: rm -rf dist diff --git a/changelog/unreleased/set-cgo-enabled-0-flag.md b/changelog/unreleased/set-cgo-enabled-0-flag.md new file mode 100644 index 0000000000..5ea66fc500 --- /dev/null +++ b/changelog/unreleased/set-cgo-enabled-0-flag.md @@ -0,0 +1,8 @@ +Bugfix: Set CGO_ENABLED flag for 'scratch' based docker builds + +The CGO_ENABLED=0 flag was added to the docker build flags so that it will +produce a static build. This allows usage of the 'scratch' image for +reduction of the docker image size. + +https://github.com/cs3org/reva/issues/1765 +https://github.com/cs3org/reva/pull/1766 \ No newline at end of file