oci-build-task icon indicating copy to clipboard operation
oci-build-task copied to clipboard

[Feature Request] Allow Dockerfile literal in task cfg

Open eckdanny opened this issue 3 years ago • 2 comments

For simple uses cases like:

- task: build-image
   ...
      inputs:
      - name: my-build-output-from-another-task
        path: .
      params:
      - DOCKERFILE: |
         FROM nginx
         COPY . /usr/share/nginx/html

this is attractive for the same reasons as Dockerfile [with/without] context from stdin.

eckdanny avatar Mar 19 '22 15:03 eckdanny

What is the best workaround in the meantime?

[Guessing]: put another task before the oci-build-task to write a 2-line Dockerfile to outputs, and then add to inputs?

eckdanny avatar Mar 19 '22 15:03 eckdanny

What is the best workaround in the meantime?

I do this for a project of mine

  - task: push-image
    ...
      inputs:
      - name: bin
      run:
        path: sh
        args:
        - -c
        - |
          cat <<EOF > Dockerfile
          FROM arm64v8/ubuntu
          COPY bin/singh3 /usr/bin/singh3
          CMD ["singh3"]
          EOF
          build

natto1784 avatar Mar 28 '22 21:03 natto1784