- 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.
- Web前端開發技術:HTML、CSS、JavaScript(第3版)
- 自己動手寫搜索引擎
- MySQL數據庫應用與管理 第2版
- OpenStack Cloud Computing Cookbook(Fourth Edition)
- Mastering OpenCV 4
- HTML5+CSS3網站設計教程
- Mastering Linux Security and Hardening
- 響應式架構:消息模式Actor實現與Scala、Akka應用集成
- 編程改變生活:用Python提升你的能力(進階篇·微課視頻版)
- C編程技巧:117個問題解決方案示例
- Drupal 8 Development Cookbook(Second Edition)
- After Effects CC案例設計與經典插件(視頻教學版)
- SaaS攻略:入門、實戰與進階
- Java程序設計(項目教學版)
- 匯編語言程序設計