拉取OpenSUSE 镜像源
docker pull opensuse/leap:15.5
Dockerfile
FROM opensuse/leap:15.5
RUN \
zypper mr -da; \
zypper ar -cfg ‘https://mirrors.tuna.tsinghua.edu.cn/opensuse/distribution/leap/$releasever/repo/oss/’ mirror-oss; \
zypper ar -cfg ‘https://mirrors.tuna.tsinghua.edu.cn/opensuse/distribution/leap/$releasever/repo/non-oss/’ mirror-non-oss;\
zypper ar -cfg ‘https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/oss/’ mirror-update; \
zypper ar -cfg ‘https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/non-oss/’ mirror-update-non-oss; \
zypper ar -cfg ‘https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/sle/’ mirror-sle-update; \
zypper ar -cfg ‘https://mirrors.tuna.tsinghua.edu.cn/opensuse/update/leap/$releasever/backports/’ mirror-backports-update; \
zypper refresh; \
zypper install -y vim wget curl; \rpm –import https://packages.microsoft.com/keys/microsoft.asc; \
curl https://packages.microsoft.com/config/opensuse/15/prod.repo -o prod.repo; \
mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo; \
chown root:root /etc/zypp/repos.d/microsoft-prod.repo; \
zypper refresh; \
zypper install -y nano libicu dotnet-sdk-8.0; \
zypper clean;
构建
docker build –no-cache -t opensuse-dotnet-sdk-8 .
发表回复