diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 6b19f26cd..5dabe9051 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -25,3 +25,12 @@ jobs: run: | npm install -g markdownlint-cli markdownlint *.md + hadolint: + name: hadolint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Hadolint + uses: hadolint/hadolint-action@v3.1.0 + with: + recursive: true diff --git a/.hadolint.yml b/.hadolint.yml new file mode 100644 index 000000000..0d079d9e9 --- /dev/null +++ b/.hadolint.yml @@ -0,0 +1,3 @@ +ignored: + - DL3008 + - DL3028 diff --git a/CHANGELOG.md b/CHANGELOG.md index 995c47d80..6b31058fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Ability to set Web Builder url via `WEB_BUILDER_URL` * Add `yamllint` check in CI * Add `dependabot` check for `GitHub Actions` +* Add `hadolint` check in CI. ### Changes diff --git a/Dockerfile b/Dockerfile index 0f25f9347..d2c8fed4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,28 @@ FROM ruby:3.3 -MAINTAINER Pavel.Lobashov "shockwavenn@gmail.com" - -RUN apt-get update && apt-get -y -q install git curl -RUN apt-get update && apt-get -y -q install libmagic-dev \ - poppler-utils \ - time - +RUN apt-get update && \ + apt-get --no-install-recommends -y -q install \ + curl \ + git \ + libmagic-dev \ + poppler-utils \ + time && \ + rm -rf /var/lib/apt/lists/* RUN gem install bundler COPY . /doc-builder-testing WORKDIR /doc-builder-testing RUN bundle config set without 'development' && \ bundle install # Install gpg key -RUN mkdir -p -m 700 ~/.gnupg -RUN curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --import -RUN chmod 644 /tmp/onlyoffice.gpg -RUN chown root:root /tmp/onlyoffice.gpg -RUN mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN mkdir -m 700 ~/.gnupg && \ + curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --import && \ + chmod 644 /tmp/onlyoffice.gpg && \ + chown root:root /tmp/onlyoffice.gpg && \ + mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg # Write repository & install docbuilder RUN echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] http://download.onlyoffice.com/repo/debian squeeze main" >> /etc/apt/sources.list.d/onlyoffice.list && \ apt-get -y update && \ - apt-get -y install onlyoffice-documentbuilder -ENTRYPOINT ["rake"] + apt-get --no-install-recommends -y install onlyoffice-documentbuilder && \ + rm -rf /var/lib/apt/lists/* +CMD ["bash", "entrypoint.sh"] diff --git a/dockerfiles/debian-develop/Dockerfile b/dockerfiles/debian-develop/Dockerfile index 7e29b298a..9ca2ceecd 100644 --- a/dockerfiles/debian-develop/Dockerfile +++ b/dockerfiles/debian-develop/Dockerfile @@ -1,25 +1,27 @@ FROM ruby:3.3 -MAINTAINER Pavel.Lobashov "shockwavenn@gmail.com" ENV VERSION="99.99.99" ENV DIST="stable" -RUN apt-get update && apt-get -y -q install git \ - curl \ - libmagic-dev \ - poppler-utils +RUN apt-get update && \ + apt-get --no-install-recommends -y -q install \ + git \ + curl \ + libmagic-dev \ + poppler-utils && \ + rm -rf /var/lib/apt/lists/* RUN gem install bundler COPY . /doc-builder-testing WORKDIR /doc-builder-testing RUN bundle config set without 'development' && \ bundle install +SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN echo "deb [trusted=yes] https://s3.eu-west-1.amazonaws.com/repo-doc-onlyoffice-com/repo/debian $DIST $VERSION" | \ tee /etc/apt/sources.list.d/onlyoffice-dev.list && \ apt-get -y update && \ - apt-get -y install onlyoffice-documentbuilder + apt-get --no-install-recommends -y install onlyoffice-documentbuilder && \ + rm -rf /var/lib/apt/lists/* RUN cat /etc/apt/sources.list.d/onlyoffice-dev.list -CMD /bin/bash -c "onlyoffice-documentbuilder -v; \ - cd /doc-builder-testing; \ - rake rspec_critical" +CMD ["sh", "dockerfiles/entrypoint.sh"] diff --git a/dockerfiles/debian-next-release/Dockerfile b/dockerfiles/debian-next-release/Dockerfile index 9582cb6b0..24e02f28e 100644 --- a/dockerfiles/debian-next-release/Dockerfile +++ b/dockerfiles/debian-next-release/Dockerfile @@ -4,22 +4,25 @@ MAINTAINER Pavel.Lobashov "shockwavenn@gmail.com" ENV VERSION="8.2.1" ENV DIST="stable" -RUN apt-get update && apt-get -y -q install git \ - curl \ - libmagic-dev \ - poppler-utils +RUN apt-get update && \ + apt-get --no-install-recommends -y -q install \ + git \ + curl \ + libmagic-dev \ + poppler-utils && \ + rm -rf /var/lib/apt/lists/* RUN gem install bundler COPY . /doc-builder-testing WORKDIR /doc-builder-testing RUN bundle config set without 'development' && \ bundle install +SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN echo "deb [trusted=yes] https://s3.eu-west-1.amazonaws.com/repo-doc-onlyoffice-com/repo/debian $DIST $VERSION" | \ tee /etc/apt/sources.list.d/onlyoffice-dev.list && \ apt-get -y update && \ - apt-get -y install onlyoffice-documentbuilder=$VERSION-* + apt-get --no-install-recommends -y install onlyoffice-documentbuilder=$VERSION-* && \ + rm -rf /var/lib/apt/lists/* RUN cat /etc/apt/sources.list.d/onlyoffice-dev.list -CMD /bin/bash -c "onlyoffice-documentbuilder -v; \ - cd /doc-builder-testing; \ - rake rspec_critical" +CMD ["sh", "dockerfiles/entrypoint.sh"] diff --git a/dockerfiles/entrypoint.sh b/dockerfiles/entrypoint.sh new file mode 100644 index 000000000..ecd261080 --- /dev/null +++ b/dockerfiles/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +onlyoffice-documentbuilder -v +cd /doc-builder-testing +rake rspec_critical diff --git a/dockerfiles/rockylinux-latest/Dockerfile b/dockerfiles/rockylinux-latest/Dockerfile index e7d53a39c..4b285416d 100644 --- a/dockerfiles/rockylinux-latest/Dockerfile +++ b/dockerfiles/rockylinux-latest/Dockerfile @@ -6,6 +6,7 @@ RUN bundle config set without 'development' && \ bundle install RUN bundle config set without 'development' && \ bundle install -RUN dnf -y install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm -RUN dnf -y install onlyoffice-documentbuilder -CMD rake rspec_critical +RUN dnf -y install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm && \ + dnf -y install onlyoffice-documentbuilder && \ + dnf clean all +CMD ["sh", "dockerfiles/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 000000000..5a6e92f22 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +onlyoffice-documentbuilder -v +cd /doc-builder-testing +rake