Method of installing Mono internally Docker Container --- From official website

1. What is the first mono

Mono is a Xamarin by the company (previously Novell, the earliest Ximian) free open-source project hosted. The project goal is to create a series of matches ECMA standard (Ecma-334 and Ecma- 335 ) of .NET tools, including C # compiler and a Common Language architectures. Microsoft's .NET Framework (common language runtime platform) different, Mono project can not only run on a Windows system, it can also run on Linux, FreeBSD, Unix, OS X and Solaris, and even some gaming platforms, such as: Playstation 3 , Wii or XBox 360 

is taken from Baidu Encyclopedia

2. The need to use mono when the company's product development 

3. The easiest way is to use Microsoft's dotnet sdk install mono image

4. himself scarcely knew mono.

The easiest way to find mono from hub.docker inside to find a way to create dockerfile can directly use

6. dockerfile connected to a corresponding version number to click on the inside

HTTPS: // github.com/mono/docker/blob/c47c852008be6934ac650f282c18c70f2cfec72f/6.0.0.313/slim/Dockerfile 

URL here

note the contents of which are as follows:

FROM debian:stretch-slim
   
  # MAINTAINER Jo Shields <[email protected]>
  # MAINTAINER Alexander Köplinger <[email protected]>
   
  ENV MONO_VERSION 6.0.0.313
   
  RUN apt-get update \
  && apt-get install -y --no-install-recommends gnupg dirmngr \
  && rm -rf /var/lib/apt/lists/* \
  && export GNUPGHOME="$(mktemp -d)" \
  && gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
  && gpg --batch --export --armor 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF > /etc/apt/trusted.gpg.d/mono.gpg.asc \
  && gpgconf --kill all \
  && rm -rf "$GNUPGHOME" \
  && apt-key list | grep Xamarin \
  && apt-get purge -y --auto-remove gnupg dirmngr
   
  RUN echo "deb http://download.mono-project.com/repo/debian stable-stretch/snapshots/$MONO_VERSION main" > /etc/apt/sources.list.d/mono-official-stable.list \
  && apt-get update \
  && apt-get install -y mono-runtime \
  && rm -rf /var/lib/apt/lists/* /tmp/*
 

7. 自己修改一下(庆幸的是 dotnet sdk 也使用的ubuntu 直接可以用如上的命令进行处理)

 

FROM dotnetsdk2.1vimssh:gscloud1906
# 注意这里是使用了自己安装 vim 的 images 进行的后续处理

RUN apt-get update \
  && apt-get install -y --no-install-recommends gnupg dirmngr \
  && rm -rf /var/lib/apt/lists/* \
  && export GNUPGHOME="$(mktemp -d)" \
  && gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
  && gpg --batch --export --armor 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF > /etc/apt/trusted.gpg.d/mono.gpg.asc \
  && gpgconf --kill all \
  && rm -rf "$GNUPGHOME" \
  && apt-key list | grep Xamarin \
  && apt-get purge -y --auto-remove gnupg dirmngr
ENV MONO_VERSION 6.0.0.313

RUN echo "deb http://download.mono-project.com/repo/debian stable-stretch/snapshots/$MONO_VERSION main" > /etc/apt/sources.list.d/mono-official-stable.list \
  && apt-get update \
  && apt-get install -y mono-runtime \
  && rm -rf /var/lib/apt/lists/* /tmp/*

8. 执行docker build 就可以生成带mono的环境了。 

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/11257728.html