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

Implement Docker Image custom resource functionality #404

Closed
guineveresaenger opened this issue Oct 24, 2022 · 5 comments
Closed

Implement Docker Image custom resource functionality #404

guineveresaenger opened this issue Oct 24, 2022 · 5 comments
Labels
kind/enhancement Improvements or new features kind/task Work that's part of an ongoing epic resolution/fixed This issue was fixed
Milestone

Comments

@guineveresaenger
Copy link
Contributor

Depends on #403

Issue details

Implement full pulumi-native CRUD lifecycle for Docker Image, but superimposed on the TF provider for backwards compatibility and user friendliness
Previous PoC here: https://github.com/guineveresaenger/pulumi-docker-native - please ask for access

This issue may be broken up into multiple sub-issues as we're really adding a full mini-provider here.

Affected area/feature

Docker Image resource in this provider

@guineveresaenger guineveresaenger added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team and removed needs-triage Needs attention from the triage team labels Oct 24, 2022
@guineveresaenger guineveresaenger added the kind/task Work that's part of an ongoing epic label Oct 24, 2022
@guineveresaenger guineveresaenger changed the title Implement Docker Image acustom resource functionality Implement Docker Image custom resource functionality Oct 27, 2022
@guineveresaenger
Copy link
Contributor Author

I am working off of this feature branch , adding the Create function for docker.Image, using the Docker Go SDK to build a Docker image and push it to the given registry.

I've been able to create and push an image, and then also use the existing Container resource to run a container off the created image.

A few notes on backwards compatibility with the component resource implementation:

  • schematizing the Registry inputs is fairly straightforward
  • It's unclear if the behavior details of baseImageName vs imageName vs tagging logic can be put into the new schema for easy migration. I will dig into that next!

@guineveresaenger
Copy link
Contributor Author

guineveresaenger commented Nov 5, 2022

#414 has the current updates for today:

For the schema we have increased feature parity with the current implementation, specifically:

  • we can set skipPush and only build and tag a local image. Default is false.

  • all fields are renamed to match the fields in the current implementation

  • DockerBuild is now a full Type, just like Registry.

  • On Image, the build field is no longer required because we set reasonable defaults instead.

  • I am changing the default understanding of imageName to be a simple image name, without referring to a remote registry. If skipPush is set to false, we additionally tag the built image with a remote registry qualified name (via the server field from registry) and additionally declare a registryImageName Output field that reflects this additional tag. We do not need a separate localImageName here.

    • On skipPush: false, sample image build and push will result in two tagged formats of the same image hash:
    $ docker images
    REPOSITORY            TAG           IMAGE ID       CREATED              SIZE
    gsaenger/guinsimage   latest        74c3afd57024   About a minute ago   142MB
    guinsimage            latest        74c3afd57024   About a minute ago   142MB
    
    • This will allow a user to pass along either imageName or registryImageName to, say, a local container build.
  • There is a new Output, registryImageName, see above.

Behavior is verified via a local Pulumi Typescript program.

Next up: Implementing additional fields in the DockerBuild type:

  • cacheFrom
  • env
  • extraOptions
  • target

Still some work to be done on #413 to pass tests and linter.

@guineveresaenger
Copy link
Contributor Author

#414 has been restructured to allow for correct handling and marshaling of the Image input into Go structs. Includes first stab at implementing logic for some of the features.

@guineveresaenger guineveresaenger added this to the 0.81 milestone Nov 15, 2022
@guineveresaenger
Copy link
Contributor Author

The foundation for this is done in #413. The PR describes what has been implemented so far. I will add followup issues as we explicitly add support for additional features.

@pulumi-bot
Copy link
Contributor

Cannot close issue without required labels: resolution/

@mikhailshilkov mikhailshilkov added the resolution/fixed This issue was fixed label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features kind/task Work that's part of an ongoing epic resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

3 participants