Skip to content

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

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

Activity

  1. eddumelendez commented on Sep 10, 2022

    @eddumelendez
    Member

    @hariohmprasath thanks for the idea! I think you may be interested in #5623. Although it is not related to buildpacks it covers the same need. I think it would be great to have something similar to what the spring boot team which AFAIK doesn't use pack cli but has its own implementation. Unfortunately, it's not something we can reuse 😢

    would like to hear from @kiview and @bsideup on this one

  2. hariohmprasath commented on Sep 10, 2022

    @hariohmprasath
    ContributorAuthor

    Hi @eddumelendez, Thanks for your response and pointing me to the PR.

    Here are my two cents:
    Based on my experience jLib only supports building java docker images, but users working with testcontainers would like to launch on-the-fly containers based on any language runtime for a variety of usecases. So falling back on existing buildpack/builder implementations like paketo would help us provide support on a variety of runtimes rather than us building something of our own.

    But I would love to hear feedback from maintainers and community members. Looking forward to the discussion.

  3. locked and limited conversation to collaborators on Sep 24, 2022
  4. converted this issue into a discussion #5864 on Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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