Module 1 Homework: Docker & SQL

Solutions & Explanations


Question 1: Understanding Docker First Run

Task:

Run a Python 3.12.8 Docker image interactively with bash as the entrypoint and check the pip version.

Solution:

docker run -it --entrypoint bash python:3.12.8
root@efa3e3150bc7:/# pip --version

Answer: pip 24.3.1

Explanation:


Question 2: Docker Networking & Compose

Task:

Determine the hostname and port for pgAdmin to connect to Postgres in a Docker Compose setup.

Answer: db:5432

Explanation: