Chapter 1
1 min read
Introduction to Containers and Container Security
Exercises
In this chapter, each section had its own exercises. But here are some additional exercises relevant to the whole chapter:
In this chapter, each section had its own exercises. But here are some additional exercises relevant to the whole chapter:
- Create a project on GitHub that will contain a backend, a frontend, and some Docker files. The backend should be a simple REST API that returns a JSON object. The frontend should be a simple HTML page that displays the JSON object.
- Create a Dockerfile for the backend and the frontend. The frontend Dockerfile should use the
nginximage as a base image. The backend Dockerfile depends on the language you choose, but you can rundocker initand it will help you create a Dockerfile. - Run both images locally. Then create a Docker network and run both images on the same network. The frontend should be able to access the backend, without exposing a port.
- Create a Docker Compose file that runs both images. The frontend should be able to access the backend, without exposing a port.
- Create a Helm chart for both backend and frontend. The Helm chart should be able to deploy both images to a Kubernetes cluster. The frontend should be able to access the backend, using the service name.