Skip to content

DL3018 (pin version in apk add) fails when repository specified with -X flag #408

@v1r7u

Description

@v1r7u
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache lttng-ust=2.10.4-r0 pass the check

Actual behavior

RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache lttng-ust=2.10.4-r0 fails with

DL3018 Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>

Steps to reproduce the behavior

Run apk add -X .... The sample Dockerfile:

FROM alpine:3.11
RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache lttng-ust=2.10.4-r0

Output of hadolint --version

docker run --rm -i hadolint/hadolint hadolint --version
Haskell Dockerfile Linter v1.17.5-6-gbc8bab9

Notes

Probably, the issue could be solved just with adding X argument to the line:

dropTarget = Shell.dropFlagArg ["t", "virtual", "repository"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions