Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

feat: Lint Dockerfiles #171

Merged
merged 1 commit into from
Jan 10, 2021
Merged

feat: Lint Dockerfiles #171

merged 1 commit into from
Jan 10, 2021

Conversation

l0b0
Copy link
Contributor

@l0b0 l0b0 commented Jan 7, 2021

No description provided.

@l0b0 l0b0 requested a review from imincik January 7, 2021 02:59
Copy link
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

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

@l0b0 , looks ok except one thing I asked to reconsider. Thanks

@@ -1,19 +1,26 @@
FROM ubuntu:20.04 as build

RUN apt-get update \
&& apt-get install -y curl python3-pip \
&& apt-get install --assume-yes --no-install-recommends curl=7.68.0-1ubuntu2.4 python3-pip=20.0.2-5ubuntu1.1 \
Copy link
Contributor

Choose a reason for hiding this comment

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

Apt package versions as above

@@ -1,6 +1,8 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt update && apt install -y python3 && rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends python3=3.8.2-0ubuntu2 \
Copy link
Contributor

Choose a reason for hiding this comment

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

@l0b0 , are you sure we need to specify apt packages versions here ? The only distribution upgrades are bug fixes. I think this is not necessary.

Copy link
Contributor Author

@l0b0 l0b0 Jan 7, 2021

Choose a reason for hiding this comment

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

Pro locking versions:

  • Makes it less likely to break things arbitrarily. Even OS package patches sometimes sneak in functional changes which impact systems. Reproducibility is a huge win.

Cons:

  • Even if we install fixed versions of the top level packages, we might get updated versions of their dependencies. Apt AFAIK does not have a lockfile mechanism like NPM and Poetry, meaning that locking all the package dependencies is a bit more of a chore.
  • Dependabot does not yet patch Dockerfile package installs.

Once Dependabot supports apt-get within Dockerfiles that fixes both of the above - we could just lock the package dependencies in the apt-get command once and Dependabot would take care of keeping them up to date. So on balance I agree for now. Documented.



FROM ubuntu:20.04

ENTRYPOINT ["/opt/.venv/bin/python", "/opt/task.py"]

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y python3 && rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends python3=3.8.2-0ubuntu2 \
Copy link
Contributor

Choose a reason for hiding this comment

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

Apt package versions as above

Ignore rule to force setting specific package versions since

- Ubuntu should only be receiving non-breaking patches,
- we don't want the overhead of having to follow up on every package
  upgrade manually (see
  dependabot/dependabot-core#2129), and
- locking only the top level packages means we'd still get arbitrary
  versions of their dependencies.
Copy link
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

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

Thanks @l0b0

@l0b0 l0b0 added the automerge label Jan 10, 2021
@kodiakhq kodiakhq bot merged commit bbc6eb9 into master Jan 10, 2021
@kodiakhq kodiakhq bot deleted the lint-dockerfiles branch January 10, 2021 18:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants