diff --git a/Dockerfile.revad-eos b/Dockerfile.revad-eos index 59a1bc861e..fe8171c82d 100644 --- a/Dockerfile.revad-eos +++ b/Dockerfile.revad-eos @@ -16,12 +16,13 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -FROM gitlab-registry.cern.ch/dss/eos/eos-fusex:4.8.91 +FROM gitlab-registry.cern.ch/dss/eos/eos-fusex:4.8.91 as builder -RUN yum -y update && yum clean all - -RUN yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm -RUN yum install -y make git gcc libc-dev bash epel-release golang && \ +RUN yum -y install \ + gcc \ + git \ + golang \ + make && \ yum clean all && \ rm -rf /var/cache/yum @@ -34,15 +35,16 @@ RUN rm -rf /usr/local/go && \ ENV PATH /go/bin:/usr/local/go/bin:$PATH ENV GOPATH /go - WORKDIR /go/src/github/cs3org/reva COPY . . -RUN make build-revad-docker && cp /go/src/github/cs3org/reva/cmd/revad/revad /usr/bin/revad +RUN make build-revad-docker -RUN mkdir -p /etc/revad/ && echo "" > /etc/revad/revad.toml -RUN mkdir -p /usr/local/bin +FROM gitlab-registry.cern.ch/dss/eos/eos-all:4.8.91 +COPY --from=builder /go/src/github/cs3org/reva/cmd/revad/revad /usr/bin/revad RUN chmod +x /usr/bin/revad +RUN mkdir -p /etc/revad/ && \ + touch /etc/revad/revad.toml ENTRYPOINT [ "/usr/bin/revad" ] CMD [ "-c", "/etc/revad/revad.toml", "-p", "/var/run/revad.pid" ] diff --git a/changelog/unreleased/dockerfile.revad-eos.md b/changelog/unreleased/dockerfile.revad-eos.md new file mode 100644 index 0000000000..531adaf472 --- /dev/null +++ b/changelog/unreleased/dockerfile.revad-eos.md @@ -0,0 +1,11 @@ +Enhancement: Bring back multi-stage build to save on image size +- Use EOS 4.8.91 as base image +- Bring back multi-stage build +- Build revad on the eos 4.8.91 image due to missing dependency (`ld-musl-x86_64.so.1`, typical of alpine) +- Copy the resulting revad from the builder container + +Resulting image size (unpacked on disk) is 2.59GB +- eos-all:4.8.91 is 2.47GB +- existing revad:latest-eos is 6.18GB + +https://github.com/cs3org/reva/pull/3197