Skip to content

[Feature]: Support creating containers on-the-fly using CloudNative buildpacks #5828

@hariohmprasath

Description

@hariohmprasath

Module

Core

Problem

Currently, as a developer I can create temporary containers on the fly from a docker file using ImageFromDockerfile class. But what if I don’t have a Dockerfile and I just want to point to a codebase and generate a container image out of it on the fly and use the same container to run some integration tests? Currently, it’s not possible. Here are some scenarios when a docker file is not available during the initial development phase:

  • In an enterprise setup Dockerfile is created and maintained by DevOps/SecOps team so as a developer I have to wait till I get a formally approved docker file before I run any tests using testcontainers

  • If I have a legacy application, then creating a docker file will require much more efforts from the team as they have to research on the supported runtime, dependencies, etc before building one

Solution

Add support CloudNative buildpacks

Benefit

By supporting buildpacks users don’t need to create or manage docker files. After buildpack integration with testcontainers users can point the source code and generate containers on-the-fly without a docker file.

Example:

ImageFromDockerfile.withBuildPack(‘<folder_path>‘,’<builder>‘)

This is one of the most popular use case that most enterprise uses to quickly modernize their applications. @eddumelendez let me know teams thoughts on this as always I would love to contribute if we approve the proposal.

Alternatives

The user have to create a Dockerfile and then use it to create an image with testcontainers.

Would you like to help contributing this feature?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions