Skip to content

Commit

Permalink
Improve Dockerfile.revad-eos (#3197)
Browse files Browse the repository at this point in the history
* docker-revad-eos: Use eos-all:4.8.91 as base image

* docker-revad-eos: Don't you update

* docker-revad-eos: Sort and split install packages

* docker-revad-eos: Small refeactor for readability

* docker-revad-eos: Build revad binary on eos-all image (due to missing ld-musl-x86_64.so.1)

* docker-revad-eos: Add changelog

* Update changelog/unreleased/dockerfile.revad-eos.md

Co-authored-by: Samuel Alfageme <samuel.alfageme@gmail.com>

* Update dockerfile.revad-eos.md

* docker-revad-eos: Fix linter

* docker-revad-eos: Use eos-fusex image

* docker-revad-eos: Fix linter (again)

* docker-revad-eos: Fix linter (againx2)

Co-authored-by: Jimil Desai <47107987+jimil749@users.noreply.github.com>
Co-authored-by: Samuel Alfageme <samuel.alfageme@gmail.com>
  • Loading branch information
3 people authored Dec 2, 2022
1 parent 4fe6d90 commit c3e9948
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Dockerfile.revad-eos
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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" ]
11 changes: 11 additions & 0 deletions changelog/unreleased/dockerfile.revad-eos.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c3e9948

Please sign in to comment.