kodiak icon indicating copy to clipboard operation
kodiak copied to clipboard

chore(bot): change Docker base image to python:3.7-slim

Open etiennetremel opened this issue 3 years ago • 6 comments

While scanning the Kodiak Docker image with Grype, we noticed a significant amount of vulnerabilities.

This PR upgrade the base image to the latest 3.7 image and use the slim version which come with a smaller size and reduce the attack surface. I also took the opportunity to use a non root user.

  • previously: image size 1.31GB, 3694 vulnerabilities
  • now: image size 607Mb, 87 vulnerabilities

etiennetremel avatar Mar 28 '22 20:03 etiennetremel

Deploy request for kodiak-docs pending review.

Visit the deploys page to approve it

Name Link
Latest commit de7643dff739daafeb9de61f778f701e9345c8e5

netlify[bot] avatar Mar 28 '22 20:03 netlify[bot]

Deploy request for kodiak-dashboard-staging pending review.

Visit the deploys page to approve it

Name Link
Latest commit de7643dff739daafeb9de61f778f701e9345c8e5

netlify[bot] avatar Mar 28 '22 20:03 netlify[bot]

Nice, I love that smaller image size!

sbdchd avatar Mar 29 '22 00:03 sbdchd

Anything else I can help with?

etiennetremel avatar Apr 19 '22 20:04 etiennetremel

@etiennetremel It looks the CI job for building the bot container failed. Should be good to merge once that's fixed

chdsbd avatar Apr 20 '22 21:04 chdsbd

ah, that's interesting.. it worked on my machine 😛 I made a few changes, let's see how that goes

etiennetremel avatar Apr 21 '22 11:04 etiennetremel

@chdsbd anychance you could run the docker build job with credentials? image

etiennetremel avatar Sep 23 '22 06:09 etiennetremel

Not sure why CI is failing

chdsbd avatar Oct 05 '22 02:10 chdsbd

Not sure why CI is failing

Error was being triggered during the pip install of poetry, for this use case I reckon we can safely use the flag --root-ignore-action=ignore as we then use kodiak as user to run the app from supervisord.

etiennetremel avatar Oct 05 '22 07:10 etiennetremel

Oh I think we need to update CI to install git for the script to pass:

https://app.circleci.com/pipelines/github/chdsbd/kodiak/2726/workflows/6fe5f10b-3fc1-4ecd-a1ea-faf4347e28c1/jobs/25425

since the slim version of the image doesn't have it

sbdchd avatar Nov 01 '22 00:11 sbdchd

@etiennetremel @sbdchd any change you could give this another look? it would be really nice to get vulnerabilities resolved

novascreen avatar Oct 03 '23 18:10 novascreen

@novascreen it's pretty old but I just rebased the branch. The Docker credentials are missing in CircleCI, I reckon only @sbdchd or @chdsbd would be able to help with it.

etiennetremel avatar Oct 03 '23 19:10 etiennetremel

Awesome, thank you!

novascreen avatar Oct 25 '23 21:10 novascreen