• Docker运行 Mono


    Docker运行 Mono

    Docker 是最近相当热门的一个名词,它是一个基于 Linux Container 的轻量化的虚拟技术,而微软也相当积极与 Docker 合作,在 Azure 上支持这个火热的技术,并且提供简单的方式来建立 Docker Host,本文将会介绍如何在 Azure 上使用 Docker运行DockerMono镜像。

    Docker 简介

    Docker 是一个开源的项目,主要的特点是能将应用程序包装在一个 LXC (Linux Container) 容器中,当这些应用被包装进容器后,部署、迁移都变得更为简单。与传统的虚拟化技术相比,虚拟机需要安装操作系统才能执行应用程序,而 Container 则不需要安装操作系统就能运行应用程序。Container 技术是一种在 操作系统内的 Kernel 层所打造虚拟运行环境,所以 Container 彼此之间共享了 Host OS 的 Kernel,但通过namespace 区分来达到隔离每个容器的目的。

    本文并不会针对 Docker 这个技术做深入的介绍,主要着重在 Azure 对于 Docker 所提供的支持做介绍,详细了解可以参考 Docker 入门教程

    在 Azure 上建立 Docker Host

    Docker 可以运行在 Linux 操作系统之下,所以如果要在 Azure 上使用 Docker,您也可以自行建立一个Linux VM,并在上面安装 并运行Docker Deamon 。而微软在正式宣布与 Docker 密切合作后,推出了对 Docker 的直接支持,CentOS 7 中 Docker 的安装

    Docker 软件包已经包括在默认的 CentOS-Extras 软件源里。因此想要安装 docker,只需要运行下面的 yum 命令:

    [root@Mono ~]# yum install docker

    启动 Docker 服务

    [root@ Mono ~]# systemctl start docker.service

    [root@ Mono ~]# systemctl enable docker.service

    下载官方的 CentOS 镜像到本地

    [root@Mono ~]# docker pull centos

    centos:latest: The image you are pulling has been verified

    511136ea3c5a: Pull complete

    5b12ef8fd570: Pull complete

    34943839435d: Pull complete

    Status: Downloaded newer image for centos:latest

    确认 CentOS 镜像已经被获取:

    [root@Mono ~]# docker images centos

    REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE

    centos latest 34943839435d 13 days ago 224 MB

    运行一个 Docker 容器:

    [root@Mono ~]# docker run -i -t centos /bin/bash

    [root@5d841f64f6f0 /]# ls /etc

    BUILDTIME group nsswitch.conf rpm

    DIR_COLORS group- openldap sasl2

    DIR_COLORS.256color gshadow opt securetty

    DIR_COLORS.lightbgcolor gshadow- os-release security

    GREP_COLORS gss pam.d selinux

    X11 host.conf passwd services

    aliases hostname passwd- shadow

    alternatives hosts pkcs11 shadow-

    bash_completion.d hosts.allow pki shells

    bashrc hosts.deny pm skel

    binfmt.d init.d popt.d ssl

    centos-release inputrc prelink.conf.d sysconfig

    chkconfig.d iproute2 printcap sysctl.d

    cron.daily issue profile system-release

    cron.hourly issue.net profile.d system-release-cpe

    csh.cshrc krb5.conf protocols systemd

    csh.login ld.so.conf rc.d terminfo

    dbus-1 ld.so.conf.d rc0.d tmpfiles.d

    default libaudit.conf rc1.d udev

    dracut.conf.d libuser.conf rc2.d virc

    environment localtime rc3.d xdg

    exports login.defs rc4.d xinetd.d

    filesystems logrotate.d rc5.d yum

    fstab magic rc6.d yum.conf

    gcrypt modules-load.d redhat-release yum.repos.d

    gnupg motd resolv.conf

    groff mtab rpc

    我们可以看到,CentOS 容器已经被启动,并且我们得到了 bash 提示符。在 docker 命令中我们使用了 "-i 捕获标准输入输出"和 "-t 分配一个终端或控制台"选项。若要断开与容器的连接,输入 exit。

    [root@5d841f64f6f0 /]# exit

    Exit

    我们还可以搜索基于 mono的容器。 发现已经有非常多的mono容器,我们开始玩docker mono。

    [root@Mono ~]# docker search mono

    NAME DESCRIPTION STARS OFFICIAL AUTOMATED

    mono Mono is an open source implementation of M... 24 [OK]

    akoeplinger/mono-aspnetvnext Image containing everything needed to play... 14 [OK]

    monokrome/wine 4 [OK]

    monokrome/node 3 [OK]

    friism/mono 2 [OK]

    benhall/docker-mono Docker file at https://github.com/Ben Hall/... 2

    devdiv/ubuntu-mono 1

    nacyot/fsharp-mono 1 [OK]

    caseyjbenko/docker-mono 1 [OK]

    nacyot/csharp-mono 1 [OK]

    rexm/mono-docker 1 [OK]

    prozachj/docker-mono-aspnetvnext 1 [OK]

    clarktlaugh/mono 0 [OK]

    marcells/mono 0 [OK]

    seif/docker-mono-fastcgi-nginx 0 [OK]

    fghedin/docker-mono 0 [OK]

    shaunol/mono-owin-webapi 0 [OK]

    seif/mono-runit 0 [OK]

    timefairy/debian-mono 0 [OK]

    shaunol/learning-mono 0 [OK]

    rmacdonaldsmith/docker-debian-mono-devel 0 [OK]

    misakai/mono Mono and LLVM on Debian 0

    bryanayers/centos7-mono-snapshot 0 [OK]

    fghedin/docker-mono-hello 0 [OK]

    acazau/docker-mono 0 [OK]

    andmos/mono Baseimage for Mono-runtime. 0

    eflab/mono 0

    jbonhag/mono-hosting-wcf 0 [OK]

    thachmai/mono-complete 0 [OK]

    andrefernandes/docker-mono 0 [OK]

    mikehadlow/ubuntu-monoxide-mono-devel 0 [OK]

    allunite/mono-base Ubuntu with Mono base image 0

    wimperdt/mono-in-docker 0 [OK]

    ahmet/docker-mono-build 0 [OK]

    pmcgrath/mono 0

    allunite/buildimage-mono Drone.io build image for mono apps 0

    tomrijntjes/monoculture 0 [OK]

    pjvds/mono 0

    basecrm/mono 0

    monokrome/btsync 0 [OK]

    basespace/mono 0

    robzhu/mono 0

    monokrome/zmq 0 [OK]

    bowery/mono 0

    wbonner/unity-mono 0

    wayneo/mono 0

    rwentzel/ubuntu-mono Ubuntu 13.04 with Mono 3.2.3 0

    scottrudy/mono 0

    haaf/mono-baseline A Mono 3.8 baseline with F# installed . So... 0

    monokrome/minecraft 0 [OK]

    bryanayers/centos7-mono3.10.0 0 [OK]

    tilde/mono 0

    junsuzuki/mono 0

    virkokka/mono-fsharp Ubuntu 14.04 with mono and F# 0

    pcherng/phasingapp-mono-dev 0

    bryanayers/centos7-mono3.8.0 0 [OK]

    monokrome/gitreceive 0 [OK]

    kolektiv/mono 0

    octohost/mono 0

    leptonix/mono 0

    monokrome/azure-cli 0 [OK]

    monokrome/renderize 0 [OK]

    monokrome/gitolite 0 [OK]

    paulbrennan/mono 0

    monokrome/sshd 0 [OK]

    basespace/centos-mono 0

    monokrome/nibbler 0 [OK]

    saltosystems/mono-xsp4-app 0

    clintonalee/centos6-mono 0

    endeavour/nginx-mono 0

    monokrome/chat 0 [OK]

    armbuild/crosbymichael-mono 0

    jpina/centos-mono 0

    bjornno/mono-phonebook 0

    pcherng/jellyfish-mono 0

    petee/centos-mono 0

    menziesbenwiles/test-mono 0

    nyasara/azurepymono A base ubuntu image with Mono, Azure SDK f... 0 [OK]

    allanlei/mono-fastcgi-server2 0

    petee/centos-mono-2.10.2 0

    nyasara/monobase Adds Azure SDK and IronPython to a mo no image 0

    hack13/mono310 opensuse mono 3.10 0

    originalsurfmex/monode development sandbox (uses 8080): node , exp... 0

    jgarverick/monocent Linux image with Mono framework pre-i nstalled 0

    pgrm/mono_baseimage 0

    pcherng/puma00-14-07-09-mono 0

    jgarverick/monodeb 0

    azraelrabbit/monup mono opt for jexus web server 0 [OK]

    afilimonov/hcci-solr 0 [OK]

    afilimonov/docker-solr 0 [OK]

    fireantik/fireantmonodocker 0 [OK]

    monolive/centos 0

    monofraps/centos65-base 0

    callumelgrant/docker-mono-aspnetvnext 0 [OK]

    seif/mono Debian based mono container using xam arin ... 0 [OK]

    smartprocure/mono 0 [OK]

    jamesottaway/mono Mono is an open source implementation of M... 0 [OK]

    cuda/mono Mono latest release container based o n Ubu... 0 [OK]

    crosbymichael/mono 0 [OK]

    derekslager/mono 0 [OK]

    shaunol/centos-mono 0 [OK]

    matsprea/mono-aspnetvnext Repository with MONO and the Asp.Net vnext... 0 [OK]

    djsell/mono 0 [OK]

    andystanton/exec-mono 0 [OK]

    ndelitski/mono 0 [OK]

    [root@Mono ~]#

    下载Mono的 docker镜像

    [root@Mono ~]# docker pull mono

    mono:latest: The image you are pulling has been verified

    f10807909bc5: Pull complete

    f6fab3b798be: Pull complete

    3c43ebb7883b: Pull complete

    7a1f8e485667: Pull complete

    a342319da8ea: Pull complete

    3774d7ea06a6: Pull complete

    9da8fc8d2ff5: Pull complete

    511136ea3c5a: Already exists

    Status: Downloaded newer image for mono:latest

    [root@Mono ~]#

    使用docker运行mono

    [root@Mono ~]# docker run -i -t mono bash

    )

    root@66f9d4b4c73b:/# mono -V

    Mono JIT compiler version 3.10.0 (tarball Wed Nov 5 12:50:04 UTC 2014)

    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

    TLS: __thread

    SIGSEGV: altstack

    Notifications: epoll

    Architecture: amd64

    Disabled: none

    Misc: softdebug

    LLVM: supported, not enabled.

    GC: sgen

    root@66f9d4b4c73b:/#

     
     
  • 相关阅读:
    ubuntu下安装VMware tools
    ubuntu 输入su提示认证失败的解决方法
    Squishy Bird 压扁小鸟
    js 毫秒转日期(yy-MM-dd hh:mm:ss)
    js--使用构造器函数来新建对象及操作
    css中table样式
    js 字符串截取
    JavaScript中Math--random()/floor()/round()/ceil()
    canvas draw a image
    html5 canvas simple drawing
  • 原文地址:https://www.cnblogs.com/Leo_wl/p/4170416.html
Copyright © 2020-2023  润新知