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

How to use runtime image? #17

Closed
fglaeser opened this issue Jan 5, 2021 · 2 comments
Closed

How to use runtime image? #17

fglaeser opened this issue Jan 5, 2021 · 2 comments

Comments

@fglaeser
Copy link

fglaeser commented Jan 5, 2021

Is there a way to use runtime image? I'am building a netcore3.1 application using this

    - name: Setup and Build
      uses: redhat-actions/s2i-build@v1
      with:
        path_context: '.'
        builder_image: 'registry.access.redhat.com/ubi8/dotnet-31:3.1'
        image_name: poc-cicd/api
        image_tag: latest
        log_level: 5

But the final image is 774 mb, so I assume there is no runtime image involve in the process. how can I achieve that in order to reduce the size of my final image?

Thanks

@fglaeser
Copy link
Author

fglaeser commented Jan 5, 2021

I finally used something like this.

    - name: Publish
      run: dotnet publish -c Release -o ./artifacts --nologo
    - name: Build Runtime Image
      uses: redhat-actions/s2i-build@v1
      with:
        path_context: './artifacts'
        builder_image: 'registry.access.redhat.com/ubi8/dotnet-31-runtime:3.1'
        image_name: poc-cicd/api
        image_tag: latest

@fglaeser fglaeser closed this as completed Jan 5, 2021
@divyansh42
Copy link
Member

Thanks for putting this up, this is indeed something that is worth adding to the docs/example.

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

No branches or pull requests

2 participants