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

Feature Request: Inline Dockerfile #271

Closed
Tracked by #963
johnhenry opened this issue Mar 19, 2021 · 3 comments
Closed
Tracked by #963

Feature Request: Inline Dockerfile #271

johnhenry opened this issue Mar 19, 2021 · 3 comments
Assignees
Labels
kind/enhancement Improvements or new features resolution/wont-fix This issue won't be fixed

Comments

@johnhenry
Copy link

When building an image, I would like the ability pass the content of a Dockerfile directly to the Image constructor, rather than having to reference an external context. e.g.:

import { Image } from "@pulumi/docker";
const imageName = 'trial-image';

const base = 'ghost';
const exposedPort = 2368;
const localPort = 8080;
const buildingMessage = 'building a container...';

const image = new Image(imageName, {
  imageName,
  build: {
    context: `.`,
    dockerfileContent: `
    FROM ${base}
    RUN echo '${buildingMessage}'
    EXPOSE ${exposedPort}`
  },
  skipPush: true
}, {});

Affected feature

It seems plausible to modify the DockerBuild interface within "sdk/nodejs/docker.ts" and to modify dockerBuild to pass content as the stdin parameter to runCommandThatMustSucceed* when appropriate.

I'm working on a branch here: https://github.com/johnhenry/pulumi-docker/tree/johnhenry/dockerfile-content, which seems to work for typescript, but i'm unclear on how to write tests that will be accepted for this project.

I've also included updates for python, c#, and go; but I am not an expert with these languages an am unclear how to run and test them with my local branch.

@johnhenry johnhenry added the kind/enhancement Improvements or new features label Mar 19, 2021
@johnhenry johnhenry changed the title Inline Dockerfile Feature Request: Inline Dockerfile Mar 19, 2021
@viveklak viveklak self-assigned this Mar 23, 2021
@johnhenry
Copy link
Author

Hi @viveklak I noticed that you're assigned to this and I wonder if you can take a look at my PR when you get a chance?

@mnlumi mnlumi added the kind/enhancement Improvements or new features label Jul 28, 2023
@enricoschaaf
Copy link

What's the reason the PR has been closed?

@blampe blampe added the resolution/wont-fix This issue won't be fixed label Apr 25, 2024
@blampe
Copy link
Contributor

blampe commented Apr 25, 2024

Hi @johnhenry, we just released a new Docker Build provider focused exclusively on building images with buildx/BuildKit. It provides support for inline Dockerfiles out of the box, and we recommend you use it for building images going forward. Please take a look and give us feedback!

The repository is here; our blog announcement is here; and finally API docs are here along with examples of how to migrate your existing Image resources to dockerbuild.Image.

We won't be able to add this functionality in this provider for a number of reasons, so I'm closing this as wont-fix.

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 resolution/wont-fix This issue won't be fixed
Projects
None yet
Development

No branches or pull requests

5 participants