Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-1257 make sure alpine base is updated #83

Merged
merged 3 commits into from
Feb 21, 2022

Conversation

gionn
Copy link
Member

@gionn gionn commented Feb 18, 2022

OPSEXP-1257

image on dockerhub is not updated on regular basis, e.g.:

3.15
Last pushed 3 months ago by [doijanky](https://hub.docker.com/u/doijanky)

@gionn gionn self-assigned this Feb 18, 2022
@pr-triage pr-triage bot added the PR: draft label Feb 18, 2022
@gionn gionn marked this pull request as ready for review February 18, 2022 09:42
Copy link
Member

@mteodori mteodori left a comment

Choose a reason for hiding this comment

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

please replace with 3.15.0 without sha256 that seems incorrect, semver is enough, no need to update packages

@gionn
Copy link
Member Author

gionn commented Feb 18, 2022

please replace with 3.15.0 without sha256 that seems incorrect, semver is enough, no need to update packages

hash is correct:

docker pull alpine:3.15
3.15: Pulling from library/alpine
Digest: sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300
Status: Image is up to date for alpine:3.15
docker.io/library/alpine:3.15

reason for why digest on dockhub is different than digest pulling images:
docker/hub-feedback#1925 (comment)

the combination of minor version + sha is the best approach to get controlled updates from dependabot:

  • dependabot on docker images requires sha because there is not strict semver on docker image tags
  • in addition to that, if you set 3.15.0 you are not getting any bugfix update unless manually updating to 3.15.1 when it became available.

@gionn gionn requested a review from mteodori February 18, 2022 10:00
@mteodori
Copy link
Member

  • in addition to that, if you set 3.15.0 you are not getting any bugfix update unless manually updating to 3.15.1 when it became available.

this is fine, dependabot can create the PR when there is semver

Copy link
Member

@mteodori mteodori left a comment

Choose a reason for hiding this comment

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

minor change

@@ -70,7 +70,9 @@ ENV JAVA_HOME=/usr/lib/jvm/java-${JAVA_MAJOR}-openjdk
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

RUN apk add openjdk${JAVA_MAJOR}-${JDIST}-headless
RUN apk update && \
Copy link
Member

Choose a reason for hiding this comment

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

we can use the short form apk -U upgrade and add --no-cache to all commands or add rm -vrf /var/cache/apk/* after to save a few MB of package index - see: https://newbedev.com/alpine-dockerfile-advantages-of-no-cache-vs-rm-var-cache-apk

Copy link
Member Author

Choose a reason for hiding this comment

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

doing that will download index two times (one for the upgrade and again for the apk add), it's better to delete index at the end

Copy link
Contributor

@alxgomz alxgomz left a comment

Choose a reason for hiding this comment

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

LGTM

@gionn gionn merged commit f87835f into master Feb 21, 2022
@gionn gionn deleted the OPSEXP-1257-alpine-upgrade branch February 21, 2022 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants