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