dotnet docker镜像制作

2023-12-18 18:12:04

dotnet下载地址
https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-8.0.0-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
MAINTAINER RenChing
ENV TIME_ZOME Asia/Shanghai
ENV LANG en_US.utf8
ENV DOTNET_ROOT /usr/local/dotnet
ENV PATH $PATH:$DOTNET_ROOT

ADD dotnet-runtime-8.0.0-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

文章来源:https://blog.csdn.net/wuxingge/article/details/135066646
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。