Green-Software-Foundation / carbon-aware-sdk

Carbon-Aware SDK
https://carbon-aware-sdk.greensoftware.foundation/
MIT License
463 stars 98 forks source link

[Feature Contribution]: Publish the docker file in a docker registry #262

Closed luwangshell closed 4 months ago

luwangshell commented 1 year ago

What happened?

It would be good to publish the docker image to a docker registry (e.g. GitHub Packages) so we could just consume and pass in the version of the sdk.

Code of Conduct

Feature Commitment

MartinDawson commented 1 year ago

Right now we have to do something like this:

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env

RUN wget https://github.com/Green-Software-Foundation/carbon-aware-sdk/archive/refs/tags/v1.0.0.zip

RUN apt-get update && \
  apt-get install unzip && \
  unzip v1.0.0.zip && \
  rm v1.0.0.zip

WORKDIR /carbon-aware-sdk-1.0.0/src
RUN dotnet publish CarbonAware.WebApi/src/CarbonAware.WebApi.csproj -c Release -o publish

FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /carbon-aware-sdk-1.0.0/src
COPY --from=build-env /carbon-aware-sdk-1.0.0/src/publish .

ENTRYPOINT ["dotnet", "CarbonAware.WebApi.dll"]

A few things would be a massive improvement in using the library:

Thanks for this great repo though, it's really amazing.

github-actions[bot] commented 1 year ago

This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.

danuw commented 1 year ago

Hi, thank you for those comments and sorry for the delay. We are in the process of making some of those changes, but feel free to create pull request or send links if there is anything missing. (Do you have a link for the scenario to publish registry to a container or what we have in the repo is enough now please?

YaSuenag commented 1 year ago

You already can pull WebAPI container image from GitHub Packages. Is it enough? https://github.com/Green-Software-Foundation/carbon-aware-sdk/pkgs/container/carbon-aware-sdk

github-actions[bot] commented 8 months ago

This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.

YaSuenag commented 8 months ago

I think we can close this issue.

github-actions[bot] commented 4 months ago

This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.

Sophietn commented 4 months ago

Closing because we use GitHub Packages to publish WebAPI container image.