- Docker and Kubernetes for Java Developers
- Jaroslaw Krochmalski
- 270字
- 2021-07-02 18:44:52
Networking and Persistent Storage
We learned a lot about Docker concepts in the previous chapter. We know that the container is a runtime of an image. It will contain your Java application altogether with all needed dependencies, such as JRE or an application server. But, there are rare cases when the Java application is self-sufficient. It always needs to communicate with other servers (as a database), or expose itself to others (as a web application running on the application server which needs to accept requests coming from the user or from the other applications). It's time to describe ways to open the Docker container to the outside world, networking, and persistent storage. In this chapter, you are going to learn how to configure networking, and expose and map network ports. By doing that, you will enable your Java application to communicate with other containers. Imagine the following scenario: you can have one container running a Tomcat application server with your Java application, communicating with another container running a database, PostgreSQL for example. While the Kubernetes approach to networking is somewhat different in comparison to what Docker provides by default, let's focus on Docker itself briefly now. We are going to cover Kubernetes' specific networking later on. The container communication with the outside world is not only about networking; in this chapter, we will also focus on data volumes as a way to persist the data between container run and stop cycles.
This chapter covers the following topics:
- Docker network types
- Networking commands
- Creating a network
- Mapping and exposing ports
- Volume-related commands
- Creating and removing volumes
Let's begin with Docker networking.
- Spring 5企業(yè)級(jí)開發(fā)實(shí)戰(zhàn)
- JavaScript修煉之道
- Mastering Objectoriented Python
- Python程序設(shè)計(jì)
- 匯編語言程序設(shè)計(jì)(第3版)
- Python數(shù)據(jù)分析從0到1
- C++面向?qū)ο蟪绦蛟O(shè)計(jì)習(xí)題解答與上機(jī)指導(dǎo)(第三版)
- AIRIOT物聯(lián)網(wǎng)平臺(tái)開發(fā)框架應(yīng)用與實(shí)戰(zhàn)
- OpenCV 4計(jì)算機(jī)視覺項(xiàng)目實(shí)戰(zhàn)(原書第2版)
- C/C++數(shù)據(jù)結(jié)構(gòu)與算法速學(xué)速用大辭典
- Python Interviews
- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- 玩轉(zhuǎn).NET Micro Framework移植:基于STM32F10x處理器
- Docker:容器與容器云(第2版)
- Visual C++開發(fā)寶典