Skip to content

Query "Update Instruction Alone" false detection for multiple update/install commands #5703

@malte-laukoetter

Description

@malte-laukoetter

Expected Behavior

Multiple apt-get update and apt-get install commands can be used in a single RUN instruction.

Actual Behavior

For the following two Dockerfiles the query "Update Instruction Alone" reports a problem. There is no update command that is not followed by an install command in these Dockerfiles.

FROM alpine

RUN if ! which gpg ; then \
      (apt-get update ;apt-get install --no-install-recommends gnupg=2.2.19 -y ) ; \
    fi ; \
    if ! gpg --version | grep -q '^gpg (GnuPG) 1\.' ; then \
      (apt-get update ;apt-get install --no-install-recommends dirmngr=2.2.19 -y ) ; \
    fi ; \
    rm -rf /var/lib/apt/lists/*
FROM node:19.7.0
RUN npm install sqlite3; apt-get update ;apt-get install --no-install-recommends g++;

Specifications

  • Version: snapshot-34973e9d
  • Platform: Docker
  • Subsystem: Dockerfiles
  • Query: 9bae49be-0aa3-4de5-bab2-4c3a069e40cd

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcommunityCommunity contribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions