-
Notifications
You must be signed in to change notification settings - Fork 0
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
Pin docker image versions to SHA digests in Dockerfile #291
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
#TODO pin all versions to sha digest | ||
#TODO add .dockerignore | ||
FROM node:20.11-slim as nodebuilder | ||
FROM node@sha256:ecc9a2581f8588014a49a523a9ed146d27963f6d988d11bd16bbdcb3598f5f98 as nodebuilder | ||
WORKDIR /opt/app | ||
COPY package-lock.json ./ | ||
COPY package.json ./ | ||
RUN npm install | ||
|
||
FROM ruby:3.2 as rubybuilder | ||
FROM ruby@sha256:ddc5729409d1d3222e74a5edb62d142ebd5fa47e9a98fc2905d66056eec6ae3b as rubybuilder | ||
RUN apt update -y && apt -y install rsync nano | ||
RUN cp /usr/bin/nano /usr/local/bin/ | ||
|
||
WORKDIR /opt/app | ||
COPY Gemfile Gemfile.lock ./ | ||
COPY --from=nodebuilder /usr/local/bin /usr/local/nodebin | ||
RUN rsync -a /usr/local/nodebin /usr/local/bin | ||
RUN bundle install | ||
|
||
FROM ruby:3.2-slim | ||
FROM ruby@sha256:04da59d84a16b6db4a6663a6940a5142d79a50d8727acd00f10c3701cdeb46b0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've checked all 3.2-slims (3.2.3-slim, 3.2.2-slim, 3.2.1-slim, 3.2.0-slim) - none of them are the sha in the pull request. - what is this shadigest from? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tabroughton I used this command There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tom, I think the sha Hauwa has used is from a ruby:3.2-slim image that was built on 7 Feb 2024 and updated on 13 Feb 2024. This can happen when eg. a package in the underlying OS is updated. You can see from the records in repo-info that the sha was current for the package on 7 Feb |
||
WORKDIR /opt/app | ||
COPY --from=rubybuilder /usr/local/bundle /usr/local/bundle | ||
COPY --from=rubybuilder /usr/local/bin /usr/local/bin | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sha is also not correct... how have you been getting the shadigests?