Skip to content

Commit 0a0f6c2

Browse files
authored
Fix: use golang:alpine as base and re-enable CGO for revad (#1797)
1 parent 567ec47 commit 0a0f6c2

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

Dockerfile.revad

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ RUN make build-revad-docker && \
3636

3737
RUN mkdir -p /etc/revad/ && echo "" > /etc/revad/revad.toml
3838

39-
FROM scratch
39+
FROM golang:alpine
40+
41+
RUN apk --no-cache add \
42+
mailcap
4043

4144
EXPOSE 9999 10000
4245

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ci: build-ci test lint-ci
102102

103103
# to be run in Docker build
104104
build-revad-docker: off
105-
env CGO_ENABLED=0 go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
105+
go build -ldflags ${BUILD_FLAGS} -o ./cmd/revad/revad ./cmd/revad
106106
build-reva-docker: off
107107
env CGO_ENABLED=0 go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva
108108
clean:
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
Bugfix: Set CGO_ENABLED flag for 'scratch' based docker builds
1+
Bugfix: 'golang:alpine' as base image & CGO_ENABLED just for the CLI
2+
3+
Some of the dependencies used by revad need CGO to be enabled in order to
4+
work. We also need to install the 'mime-types' in alpine to correctly
5+
detect them on the storage-providers.
26

37
The CGO_ENABLED=0 flag was added to the docker build flags so that it will
48
produce a static build. This allows usage of the 'scratch' image for
5-
reduction of the docker image size.
9+
reduction of the docker image size (e.g. the reva cli).
610

711
https://github.com/cs3org/reva/issues/1765
8-
https://github.com/cs3org/reva/pull/1766
12+
https://github.com/cs3org/reva/pull/1766
13+
https://github.com/cs3org/reva/pull/1797

0 commit comments

Comments
 (0)