dotnet docker镜像制作

dotnet下载地址
https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-8.0.100-linux-x64-binaries

node下载地址
https://mirrors.aliyun.com/nodejs-release/v16.20.2/node-v16.20.2-linux-x64.tar.gz

vim sources.list

deb http://mirrors.ustc.edu.cn/debian bullseye main
deb-src http://mirrors.ustc.edu.cn/debian bullseye main

deb http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main
deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main

deb http://mirrors.ustc.edu.cn/debian bullseye-updates main
deb-src http://mirrors.ustc.edu.cn/debian bullseye-updates main

Dockerfile

FROM debian:11
ENV TIME_ZOME Asia/Shanghai
ENV LANG en_US.utf8
ENV DOTNET_ROOT /usr/local/dotnet
ENV PATH $PATH:$DOTNET_ROOT

ADD dotnet-sdk-8.0.100-linux-x64.tar.gz /usr/local/dotnet
ADD node-v16.20.2-linux-x64.tar.gz /usr/local

COPY ["sources.list", "/etc/apt"]

RUN echo "${TIME_ZOME}" > /etc/timezone && \
    ln -sf /usr/share/zoneinfo/${TIME_ZOME} /etc/localtime && \
    ln -sf /usr/local/node-v16.20.2-linux-x64/bin/node /usr/local/bin && \
    ln -sf /usr/local/node-v16.20.2-linux-x64/bin/npm /usr/local/bin && \
    apt update && \ 
    apt -y install net-tools libicu-dev && \
    apt clean

你可能感兴趣的:(docker,dotnet,docker)