I have a docker file that install the .NET 5 SDK, and then tries to install a tool using dotnet tool install.
Upon doing so I get the warning:
Since you just installed the .NET SDK, you will need to logout or restart your session before running the tool you installed.
How do I logout or restart my session during a docker build?
I tried RUN echo "export PATH=/new/path:${PATH}" >> /root/.bashrc but that didn't seem to make any difference.
Paired down example:
FROM ubuntu as base-updates
RUN apt-get install -y wget
RUN wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN apt-get update; \
apt-get install -y apt-transport-https && \
apt-get update && \
apt-get install -y dotnet-sdk-5.0
RUN dotnet tool install --global Amazon.Lambda.Tools
## executing the newly installed tool fails
RUN dotnet lambda --help