http://linuxdot.net/bbsfile-3988
1. Install Docker:
The new version of Docker 1.7 is easy to install and, in theory, can be installed directly on any major Linux distribution.
wget-qo-https://get.docker.com/| Sh
2. Reboot your host, optional.
Reboot
3. The Docker image of the mono and Jexus servers has been built in, and this image is built on the official ubuntu:14.04.2 version, which is visible dockerfile on Hub.docker.io.
Docker Pull AZRAELRABBIT/MONUPW
4. Run the container: Create and run a container based on the image pulled down, 22/80 ports are declared within the mirror and the corresponding service is started, 22:sshd, 80:jexus
Docker run--name monojexus-d-P 32022:22-p 32080:80-v/mydata:/data AZRAELRABBIT/MONUPW
-V refers to mapping the/data path of volume[/data] in the container to the/mydata path of the host.
-P maps the port in the container to the specified port of the host, which must be a port in Dockerfile, declared with the EXPOSE directive.
--name give the container a name. Convenient follow-up management operation, otherwise with ID too wretched. [The ID of the container is a random 128-bit string, abbreviated 16-bit, but not easy to remember and manage.]
-d means that the container will be serviced later,
Note:-I Keep STDIN open even if not attached
-T Allocate a Pseudo-tty
-i-t together means running the container in the foreground process and getting the container's shell, which stops when the shell exits. At this point you can add the command line to execute at the end of the instruction,
This would seem to overwrite the command line inside the dockerfile inside the cmd[] directive.
5. Connect to the activated container by connecting the 32022 port of the host with the SSH tool.
6. Copy your MVC project or ASP. NET project to the/mydata path. and restart JWs with sudo in the SSH shell. can access the site within the container.
Note: The original intention is to directly publish the site to/mydata can directly access, but has been error, and static HTML can be, so you must ssh connected to the container, you must sudo restart JWs to normal access to ASP.NET/MVC site. The problem is to be solved.
. Container Management
To view a running container: Docker PS
View all containers: Docker ps-a
Stop container: Docker stop container name/container ID
Delete Container: Docker RM container name/container ID
. Image management:
Get/Update Image: Docker pull
Delete Image: Docker RMI image ID
First with ADMIN:MONUPW user login, in Su root:monups can use
Running Mono/jexus server in Docker and deploying an ASP. NET MVC site