Skip to content

Fix dockerlint - #8523

Open
Zoey2936 wants to merge 1 commit into
mainfrom
fix-dockerlint
Open

Fix dockerlint#8523
Zoey2936 wants to merge 1 commit into
mainfrom
fix-dockerlint

Conversation

@Zoey2936

@Zoey2936 Zoey2936 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator
  • Resolves: #

Summary

  • The PR was tested and verified that it works locally
  • Sign-off message is added to all commits
  • Tests (playwright if possible) are included
  • Screenshots before/after for front-end changes
  • Documentation has been updated or is not required
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
  • Milestone next added

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix the Docker lint (hadolint) CI workflow and normalize mixed line endings across various markdown/docs and small scripts in the repository.

Changes:

  • Normalizes line endings/formatting in QA plans and documentation markdown files.
  • Updates multiple container Dockerfiles to satisfy hadolint expectations (e.g., SHELL ... pipefail, USER user:group, JSON-array HEALTHCHECK forms).
  • Adjusts the GitHub Actions Docker lint workflow logic.

Reviewed changes

Copilot reviewed 20 out of 46 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/QA/readme.md Line ending / formatting normalization.
tests/QA/assets/backup-archive/readme.md Line ending / formatting normalization.
tests/QA/080-daily-backup-script.md Line ending / formatting normalization.
tests/QA/070-timezone-change.md Line ending / formatting normalization.
tests/QA/060-environmental-variables.md Line ending / formatting normalization.
tests/QA/050-optional-addons.md Line ending / formatting normalization.
tests/QA/040-login-behavior.md Line ending / formatting normalization.
tests/QA/030-aio-password-change.md Line ending / formatting normalization.
tests/QA/020-backup-and-restore.md Line ending / formatting normalization.
tests/QA/010-restore-instance.md Line ending / formatting normalization.
tests/QA/004-initial-backup.md Line ending / formatting normalization.
tests/QA/003-automatic-login.md Line ending / formatting normalization.
tests/QA/002-new-instance.md Line ending / formatting normalization.
tests/QA/001-initial-setup.md Line ending / formatting normalization.
php/src/Cron/UpdateMastercontainer.php Line ending / formatting normalization.
php/src/Cron/StopContainers.php Line ending / formatting normalization (includes a misleading comment).
php/src/Cron/StartContainers.php Line ending / formatting normalization.
php/src/Cron/StartAndUpdateContainers.php Line ending / formatting normalization.
php/src/Cron/CreateBackup.php Line ending / formatting normalization.
php/src/Cron/CheckBackup.php Line ending / formatting normalization.
php/public/second-tab-warning.js Line ending / formatting normalization.
manual-install/readme.md Line ending / formatting normalization.
Containers/whiteboard/Dockerfile Adjusts USER and HEALTHCHECK to be more lint-friendly.
Containers/watchtower/Dockerfile Adjusts USER to user:group form.
Containers/talk/Dockerfile Adds SHELL ... pipefail, changes USER, and switches to JSON-array HEALTHCHECK.
Containers/talk-recording/Dockerfile Adds SHELL ... pipefail, changes USER, and switches to JSON-array HEALTHCHECK.
Containers/redis/Dockerfile Adds SHELL ... pipefail, changes USER, and switches to JSON-array HEALTHCHECK.
Containers/postgresql/Dockerfile Adds SHELL ... pipefail, changes USER, and switches to JSON-array HEALTHCHECK.
Containers/onlyoffice/Dockerfile Switches to JSON-array HEALTHCHECK.
Containers/notify-push/Dockerfile Adds SHELL ... pipefail, changes USER, adjusts user/group handling, and switches to JSON-array HEALTHCHECK.
Containers/nextcloud/Dockerfile Adds SHELL ... pipefail, adjusts USER, and switches to JSON-array HEALTHCHECK.
Containers/nextcloud/config/swift.config.php Line ending / formatting normalization.
Containers/nextcloud/config/s3.config.php Line ending / formatting normalization.
Containers/mastercontainer/Dockerfile Adds SHELL ... pipefail, adjusts USER, and switches to JSON-array HEALTHCHECK.
Containers/imaginary/Dockerfile Changes USER and switches to JSON-array HEALTHCHECK (plus formatting).
Containers/fulltextsearch/Dockerfile Adjusts USER and switches to JSON-array HEALTHCHECK.
Containers/eurooffice/Dockerfile Switches to JSON-array HEALTHCHECK.
Containers/domaincheck/Dockerfile Uses USER user:group and converts HEALTHCHECK to exec form with /bin/sh -c.
Containers/docker-socket-proxy/Dockerfile Adjusts USER and switches to JSON-array HEALTHCHECK.
Containers/collabora/Dockerfile Adjusts USER and switches to JSON-array HEALTHCHECK.
Containers/clamav/Dockerfile Changes USER and switches to JSON-array HEALTHCHECK.
Containers/borgbackup/Dockerfile Adjusts USER to user:group form.
Containers/apache/supervisord.conf Line ending / formatting normalization.
Containers/apache/Dockerfile Adds SHELL ... pipefail, changes USER, and switches to JSON-array HEALTHCHECK.
.github/workflows/update-yaml.yml Line ending / formatting normalization.
.github/workflows/docker-lint.yml Updates Dockerfile discovery and hadolint invocation logic.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/docker-lint.yml Outdated
/** @var \AIO\Controller\DockerController $dockerController */
$dockerController = $container->get(\AIO\Controller\DockerController::class);

// Start apache
Comment thread Containers/notify-push/Dockerfile
Comment thread .github/workflows/docker-lint.yml Outdated
Comment thread .github/workflows/docker-lint.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 46 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Containers/clamav/Dockerfile:40

  • The image now switches to USER clamav:clamav, but the earlier ownership setup still hard-codes numeric IDs (chown -R 100:100 /var/lib/clamav). This reintroduces an implicit assumption about the upstream UID/GID mapping and can lead to permission issues if the packaged clamav user/group IDs ever differ. Consider aligning ownership with the named user/group (as done elsewhere, e.g. Containers/talk-recording/Dockerfile:49).
USER clamav:clamav
RUN set -ex; \
    freshclam --foreground --stdout

@szaimen szaimen added 3. to review Waiting for reviews enhancement New feature or request labels Aug 3, 2026
@szaimen szaimen added this to the next milestone Aug 3, 2026
@szaimen

szaimen commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Hey, thanks a lot for the PR! I'll have a look soon! :)

@szaimen

szaimen commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

@Zoey2936 thanks a lot for the PR! Can you please split the change of line endings into a different PR so that we can focus with this one on fixing the dockerlint? Thanks in advance! :)

@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Aug 5, 2026
@Zoey2936 Zoey2936 mentioned this pull request Aug 5, 2026
8 tasks
@Zoey2936
Zoey2936 force-pushed the fix-dockerlint branch 6 times, most recently from ccdac8d to bc7e850 Compare August 5, 2026 17:36
@Zoey2936 Zoey2936 changed the title Fix dockerlint and fix mixed line endings Fix dockerlint Aug 5, 2026
@Zoey2936

Zoey2936 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

@Zoey2936 thanks a lot for the PR! Can you please split the change of line endings into a different PR so that we can focus with this one on fixing the dockerlint? Thanks in advance! :)

done here and #8542

@szaimen szaimen closed this in #8542 Aug 5, 2026
@szaimen szaimen reopened this Aug 5, 2026
@szaimen

szaimen commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Please rebase this branch

@Zoey2936

Zoey2936 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

done

@szaimen

szaimen commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Please rebase instead of merging in this case

@Zoey2936
Zoey2936 force-pushed the fix-dockerlint branch 2 times, most recently from 89ebee2 to d0619ea Compare August 5, 2026 18:10
@Zoey2936

Zoey2936 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

done

@szaimen szaimen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 5, 2026
@szaimen
szaimen requested a review from pabzm August 5, 2026 18:32
Signed-off-by: Zoey <zoey@z0ey.de>
@szaimen szaimen modified the milestones: v13.5.0, next Aug 6, 2026

@pabzm pabzm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I've got a few questions and one request for a comment.

# DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
hadolint "$file" --ignore DL3018 --ignore DL4006 | tee -a ./hadolint.log
# DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
# DL3066 info: Non-numeric user-id may not be resolvable by host system

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this, despite the user-IDs being replaced by usernames in this same PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes since the dockerlint rules wants to use the id numbers instead of usernames, but I think using IDs will break faster then usernames

Comment on lines -44 to +43
if grep -q "DL[0-9]\+\|SC[0-9]\+" ./hadolint.log; then
if [ -s hadolint.log ]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite the same. Any output of executing hadolint (even coming from the shell, not even hadolint itself) would now abort the further execution of the script.

Can you explain why you changed this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because hadolint only prints to console if it finds issues and output/no-outpout is easier to detect than reading the file for a regex which could break easier


VOLUME /mnt/data

SHELL ["/bin/ash", "-o", "pipefail", "-c"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ash instead of the default sh?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# AIO settings start # Do not remove or change this line!
ENV NEXTCLOUD_VERSION=33.0.7
# hadolint ignore=DL3064

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment what this is required for.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/hadolint/hadolint/wiki/DL3064 I'm cutrently on mobile, can you please create a suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants