Docker creates an image with Tomcat installed with the process: Download the image first, start the container with mirroring, install Tomcat in the container, and then save the Tomcat container as a new image.
There are many ways Docker downloads images, such as
sudo docker pull ubuntu:14.04
14.04 means the image label of Ubuntu, if not tagged, Docker will automatically download the image of the latest tag.
Start a container with a mirror by the Run command
or use
To specify the name of the container when the container starts.
You can then install Tomcat in the container.
Specific installation method, I am here to provide a more complete download from the image to the Tomcat installation of an article
Links: http://www.21ops.com/linux/29783.html
Here is a little note that the image used in the article is not ubuntu:14.04, such as the use of ubuntu:14.04 may have a problem:
1, after installing SSH and using SSH login (~$ ssh root@127.0.0.1-p 49154), there will be Permission denied please try again.
There are a number of solutions available online for this error. The specific three categories are as follows:
A. Modify the/etc/ssh/sshd-config file to modify the Permitrootlogin No to yes,pubkeyauthentication Yes to no,authorizedkeysfile. ssh/ Authorized_keys Front plus # shield off, passwordauthentication no change to Yes
B. Modify the/etc/ssh/sshd-config file to modify the Permitrootlogin, pubkeyauthentication and passwordauthentication to Yes
C, modify the/etc/ssh/sshd-config file, change the Permitrootlogin and passwordauthentication to Yes
I read my own this file, because pubkeyauthentication is yes so I will permitrootlogin, passwordauthentication modified to Yes can be landed, in particular, according to the circumstances of their own choice.
2, in the installation
Apt-get Install python-software-properties
add-apt-repository Ppa:webupd8team/java
The second step appears: Ubuntu Add-apt-repository:command not found. The error
The solutions available online are:
In the installation
sudo apt-get install python-software-properties
Install later
sudo apt-get install Software-properties-common
And then take this one step further.
Add-apt-repository Ppa:webupd8team/java
Can.