Install docker in CENTOS6.5 and create an asp.net mvc 5 image. Run the MVC website and centos6.5docker.

Source: Internet
Author: User
Tags docker ps

Install docker in CENTOS6.5 and create an asp.net mvc 5 image. Run the MVC website and centos6.5docker.

 

Docker and containers allow R & D, testing, and production to run JAVA and net programs in a hybrid environment on linux.

 

Centos6.5 install docker reference http://my.oschina.net/kcw/blog/355612

 

Rpm-ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Rpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Yum-y install docker-io

Service docker start

Chkconfig docker on

 

 

To install the asp.net mvc5 image, see http://dockerone.com/article/164

But this tutorial made the image can only run a small DEMO, with MVC code will report reference error, should refer to the mentioned https://registry.hub.docker.com/u/microsoft/aspnet/

The final Dockerfile combined with the two is as follows:

 

FROM mono: 3.10

 

ENV KRE_VERSION 1.0.0-beta2

ENV KRE_USER_HOME/opt/kre

 

RUN apt-get-qq update & apt-get-qqy install unzip

 

RUN curl-sSL https://raw.githubusercontent.com/aspnet/home/v?kre_version/kvminstall.sh | sh

RUN bash-c "source $ KRE_USER_HOME/kvm. sh \

& Kvm install $ KRE_VERSION-a default \

& Kvm alias default | xargs-I ln-s $ KRE_USER_HOME/packages/{}$ KRE_USER_HOME/packages/default"

 

# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)

RUN apt-get-qqy install \

Autoconf \

Automake \

Build-essential \

Libtool

RUN LIBUV_VERSION = 1.0.0-rc2 \

& Amp; curl-sSL https://github.com/joyent/libuv/archive/v??libuv_version=.tar.gz | tar zxfv--C/usr/local/src \

& Cd/usr/local/src/libuv-$ LIBUV_VERSION \

& Sh autogen. sh &./configure & make install \

& Rm-rf/usr/local/src/libuv-$ LIBUV_VERSION \

& Ldconfig

 

Env path $ PATH: $ KRE_USER_HOME/packages/default/bin

 

COPY./app

WORKDIR/app

RUN ["kpm", "restore"]

 

EXPOSE 5004

ENTRYPOINT ["k", "kestrel"]

 

 

 

The following image is generated and started:

 

Docker build-t mvc.

Docker execute-t-d-p 80: 5004 mvc

 

 

Other related commands

Docker ps

Docker stop

Docker images

Docker rmi

 

 

The required DEMO code is in

Https://github.com/aspnet/Home/

 

 

Run

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.