The construction of Java Web Service based on Docker service

Source: Internet
Author: User
Tags virtual environment docker ps docker run docker registry

Guide recently thought our application needs to update the maintenance, the Android, the IOS, as well as the server side to update, is busy writing the code not to write the article. Our server is the Java SSH architecture, to the time also intends to switch to spring mvc+oauth2, today is free, we have to build a server environment before the people to see, research.

1, Docker is based on the application layer is based on a service software, at present it is used for building server development, learning Android\ios development of the use of, of course, not ruled out later can be used on the phone, so you have to learn a bit also no problem.

2, Docker is a software, through Docker, we can run a different container environment, is similar to the usual virtual machines, such as VMware, Virtual box, these VM software can be installed on the operating system, and then let us build a different operating system, Now that you have the virtual machine software, why use Docker? There are many reasons why, for developers, our answer is basically unified, I can quickly build a production environment on the server, and quickly replicate to other servers. I drew out the principles of Docker.

3. Docker extends the Linux container (Linux Containers), while LXC provides a unified set of APIs and tools to build and manage container, so Docker can take advantage of these advanced APIs to provide a lightweight virtual environment. A Docker container does not occupy a separate operating system as a virtual machine, but is based on the functionality provided by the operating system in an existing infrastructure, such as 100 containers, which use the same operating system's kernel; Let's talk about how to install the environment.

Installing Docker

According to what I have just analyzed, actually installs the software. Because different operating systems may be a little differently, this person can find information on their own, I this is the Ubuntu system, and note that the Linux operating system to 64-bit and also note that Docker needs to be in Linux Kernel 3.8 and above

$ sudo apt-get update$ sudo apt-get install docker.io$ sudo ln-sf/usr/bin/docker.io/usr/local/bin/docker$ sudo sed-i ' $acomplete-F _docker Docker '/etc/bash_completion.d/docker.io
Some of Docker's instructions View version Information
Docker version
Get Mirror
Docker Pull Ubuntu:latest
View local Mirrors
Docker images
To view the mirroring performance
Docker images Ubuntu
run Shell bash under a container
Docker Run-i-T Ubuntu/bin/bash
Stop Container
Docker stop
Download Image

Image we can go to the official website to see what images

Https://hub.docker.com/explore/
Here I take Ubuntu as an example:

  • Pull represents the download,
  • Ubuntu represents mirroring,
  • ": Latest" means the last version, which is actually the latest version.
  • Docker Pull Ubuntu:latest

    Have to say, the download super slow, sometimes may also not download, I also toss an afternoon to fix, the solution can be through the establishment of private libraries, Docker registry specific URLs:

    Https://github.com/docker/docker-registry

    Here for the time being not introduced, we can study on their own; after installation, enter:

    Docker images

    You will know if you have downloaded it locally, such as

    Start Container

    Join the shell and enter the following command

    Docker Run-i-T Ubuntu:latest/bin/bash


    At this point, you see the console has been replaced by the container command line. So we can install our environment.

    Docker Ps–a               #列出所有的容器, including those that have exited
    Exit Container

    After entering the container, the operation inside is a new operation, we have to exit the direct input exit

    Free to provide the latest Linux technology tutorials Books, for open-source technology enthusiasts to do more and better: http://www.linuxprobe.com/

    The construction of Java Web Service based on Docker service

    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.