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

Support for Docker multi-stage builds #7640

Open
1 task done
Nishnha opened this issue Jul 26, 2023 · 2 comments
Open
1 task done

Support for Docker multi-stage builds #7640

Nishnha opened this issue Jul 26, 2023 · 2 comments
Labels
L: docker Docker containers T: feature-request Requests for new features

Comments

@Nishnha
Copy link
Member

Nishnha commented Jul 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

Docker has a feature called multi-stage builds where Docker images can be split up and referenced later by name.

Dependabot currently supports updates to images using the FROM directive, but naming the images may cause the update to not work properly.

Another related issue is that Dependabot does not currently update images that have two FROM directives in a Dockerfile, which is common with multi-stage builds, as are the COPY and ARG directives

We should confirm what level of support we have for Docker images.

@Nishnha Nishnha added T: feature-request Requests for new features L: docker Docker containers labels Jul 26, 2023
@igwejk
Copy link

igwejk commented Jul 28, 2023

Hi @Nishnha 👋,

I am assigned to DVAG from the expert services team. Do you have any workaround we could possibly offer the customer until a long term solution is available?

~ https://github.com/githubcustomers/DVAG/issues/210

@Nishnha
Copy link
Member Author

Nishnha commented Aug 4, 2023

Hi @igwejk, one workaround is to split up each build stage of the multi-stage Dockerfile into separate single-stage Dockerfiles and build the image with an Actions workflow.

Dependabot should then be able to keep the images used in each single-stage Dockerfile up to date.

There are some paved paths for this - Docker has an official build-push-action which can be used to build the image, and the GitHub cache action can help avoid having to rebuild each stage of the image every time the workflow runs, saving on costs and build times.

The image can also be built as separate jobs using the upload-artifact and download-artifact actions in case that fits their use case better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: docker Docker containers T: feature-request Requests for new features
Projects
Status: No status
Development

No branches or pull requests

2 participants