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

Build directly from a Dockerfile #1662

Closed
4 tasks done
wiktor-k opened this issue Mar 21, 2023 · 2 comments
Closed
4 tasks done

Build directly from a Dockerfile #1662

wiktor-k opened this issue Mar 21, 2023 · 2 comments
Labels
feature add new functionality

Comments

@wiktor-k
Copy link

Clear and concise description of the problem

Hi,

I'm using dockerfiles extensively for various build scenarios. An added benefit is that I can immediately and locally build it and see if my changes are OK without hitting CI.

It would be cool if I could directly specify dockerfile in .woodpecker.yml to be used instead of manually converting FROM into image and RUNs into commands.

Suggested solution

Instead of:

pipeline:
  build:
    image: golang
    commands:
      - go build
      - go test

have:

FROM golang
COPY . ./
RUN go build
RUN go test

and:

pipeline:
  build:
    dockerfile: Dockerfile

(property name taken from docker compose)

Alternative

Manual conversion of the Dockerfile to woodpecker. It's error-prone and tedious. Alternatively use some converters like Earthly but they unnecessarily introduce additional dependencies. buildx plugin can specify dockerfile but it has it's own problems (e.g. it eagerly fetches image base even with pull_image: false in my tests)

Additional context

I have searched issues for "dockerfile" and the online docs.

Validations

  • Checked that the feature isn't part of the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@wiktor-k wiktor-k added the feature add new functionality label Mar 21, 2023
@qwerty287
Copy link
Contributor

We probably won't support this, but this should be possible once #1400 is implemented.

@wiktor-k
Copy link
Author

Indeed. It seems with #1400 done this could be trivial (tm). Thanks for the info! I'll close this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature add new functionality
Projects
None yet
Development

No branches or pull requests

2 participants