Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
varbanandreev authored May 11, 2020
1 parent f19c61a commit c07fcd7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Tasks/4.Building images/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# Practice - building images

Your project utilizes microservices and Kuberenetes. On your cluster you have many containers (pods) with your services. There's a special container which runs Ubuntu and can access the other services' databases and other components. To access those components you install a few CLI tools on this special container. The problem - each time the cluster is re-deployed you must install the CLI tools again because they're not part of the container's base Ubuntu image.
Your project utilizes microservices and Kuberenetes. On your cluster you have many containers (pods) with your services. Theres a special container **jumpbox** which runs Ubuntu and can access the other services' databases and other components. To access those components you install a few CLI tools on this special container. The problem - each time the cluster is re-deployed you must install the CLI tools again because they're not part of the container's base Ubuntu image.

You want to automate this process by building a Dockerfile for this container using ubuntu:18.04 as your base image.
You want to automate this process by building a Dockerfile for this container using **ubuntu:18.04** as your base image.

To install those tools you normally use the following commands:

- $ `DEBIAN_FRONTEND=noninteractive` # Env var required for postgres
- $ `DEBIAN_FRONTEND=noninteractive` # Env var required for postgres installation
- $ `apt-get update && apt-get install -y postgresql` # Install postgres to access dbs
- $ `apt-get install -y wget` # Install wget for downloading software packages
- $ `apt-get install -y curl` # Install curl for running HTTP requests

:whale: HINT: Research how to set environment variables inside Dockerfiles for the DEBIAN_FRONTEND variable.

To build the image, navigate to your Dockerfile path and use
- `docker build –t "<name>:<tag>" .`

Run a container from this image in interactive mode and verify the installations:
1. Create the above Dockerfile and build an image **jumpbox** with a **1.0** tag. Run a container with interactive bash and verify the installations:
- `psql --version` # You should see the psql version
- `wget --version` # You should see the wget version and other info
- `curl 'http://example.com'` # You should see some html
2. Change **curl** to **inetutils-ping**. Build a jumpbox version **2.0** and test again:
- `psql --version`
- `ping 8.8.8.8`

0 comments on commit c07fcd7

Please sign in to comment.