Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Dockerfile.revad-eos #3197

Merged
merged 13 commits into from
Dec 2, 2022
20 changes: 11 additions & 9 deletions Dockerfile.revad-eos
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,28 @@
# 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-all:4.8.66
FROM gitlab-registry.cern.ch/dss/eos/eos-all: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

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" ]
10 changes: 10 additions & 0 deletions changelog/unreleased/dockerfile.revad-eos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Improvement: 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
jimil749 marked this conversation as resolved.
Show resolved Hide resolved