dradis-ce icon indicating copy to clipboard operation
dradis-ce copied to clipboard

Docker build and push to github container registry

Open floriandulzky opened this issue 3 years ago • 3 comments

Expected behavior

A github action that creates a docker image and push it automatically to the github container registry (ghcr.io) See fork: https://github.com/dradis/dradis-ce/compare/develop...floriandulzky:dradis-ce:feature/docker-build

Did not create a PR yet. Will update the documentation and then make the PR. But I want to make sure this "feature" is in your interest?

floriandulzky avatar Dec 15 '22 09:12 floriandulzky

This could be improved further like this:

FROM ruby:3.1.2-slim

ARG APT="-y --no-install-recommends --no-upgrade -o Dpkg::Options::=--force-confnew"

COPY . .
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install $APT build-essential libpq-dev libsqlite3-dev git && \
   ./bin/setup skip-server && \
   # clean image
   DEBIAN_FRONTEND=noninteractive apt $APT remove build-essential gcc libmariadbd-dev libsqlite3-dev make patch wget zlib1g-dev && \
   DEBIAN_FRONTEND=noninteractive apt install $APT libmariadb3 libsqlite3-0 zlib1g && \
   DEBIAN_FRONTEND=noninteractive apt autoremove -y && \
   rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* && \
   rm -rf /data/development.sqlite3 && \
   rm -rf /vendor/bundle/ruby/3.1.0/cache /usr/local/bundle/cache

CMD ["ruby", "bin/rails", "server", "-b", "0.0.0.0"]

This reduces the image size from 1.5GB to 850MB.

PeterBennink avatar Jan 28 '23 13:01 PeterBennink

We've made some progress and added a https://github.com/dradis/dradis-ce/blob/develop/Dockerfile any thoughts?

etdsoft avatar Mar 27 '24 10:03 etdsoft

We've made some progress and added a https://github.com/dradis/dradis-ce/blob/develop/Dockerfile any thoughts?

I think you also could use FROM ruby:3.1.2-slim (untested) like @PeterBennink suggested.

floriandulzky avatar Apr 04 '24 08:04 floriandulzky

we're currently offering updated CE images via docker registry: https://hub.docker.com/r/dradis/dradis-ce

Going to close for now, but feel free to re-open if you spot any issues with our https://github.com/dradis/dradis-ce/blob/develop/Dockerfile

etdsoft avatar Oct 07 '25 13:10 etdsoft