Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error for Curl in docker file in .net core 6.0

I have modified the docker file as per the recommendations for .net core6.0. However i face error in executing the curl url in the docker file.

The command is:

RUN curl https://raw.githubusercontent.com/rdvojmoc/DinkToPdf/master/v0.12.4/64%20bit/libwkhtmltox.so --output libwkhtmltox.so

While deploying i get the error:

... docker build: executor failed running [/bin/sh -c curl https://raw.githubusercontent.com/rdvojmoc/DinkToPdf/master/v0.12.4/64%20bit/libwkhtmltox.so --output libwkhtmltox.so]: exit code: 127

Can anyone please provide any clue?

How to execute the curl urls in docker file for .net core 6.0

like image 239
Pravin Kamane Avatar asked Oct 21 '25 08:10

Pravin Kamane


1 Answers

Chances are that curl isn't installed in the container. You could install it by adding the line

RUN apt-get update \
    && apt-get install -y curl

This would be as in the Dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:6.0

RUN apt-get update \
    && apt-get install -y curl

CMD ["curl", "google.com"]
like image 93
Ryan Cahill Avatar answered Oct 24 '25 06:10

Ryan Cahill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!