Skip to content

DL3009 should ignore tmpfs mounts for apt cache #1095

@detly

Description

@detly

I have a Dockerfile where I use a tmpfs mount for the apt cache. This is because the image is built in a Docker-in-Docker image in CI, so any cache volumes will be removed when the DinD image goes away at the end of the job anyway.

DL3009 shouldn't trigger for this, since the end result is the same: the apt cache is not in the final image.

Example Dockerfile:

FROM debian:12

# PASS
# Received: [DL3009]
# Expected: [DL3009]
RUN apt-get update

# PASS
# Received: []
# Expected: []
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt apt-get update

# FAIL
# Received: [DL3009]
# Expected: []
RUN --mount=type=tmpfs,target=/var/cache/apt --mount=type=tmpfs,target=/var/lib/apt apt-get update

Output:

-:6 DL3009 info: Delete the apt-get lists after installing something
-:16 DL3009 info: Delete the apt-get lists after installing something

Version: Haskell Dockerfile Linter 2.12.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions