Learn devOps use case with docker in 10 minutes

Lim Sing
1 min readSep 5, 2022
  1. Install docker from https://docs.docker.com/engine/install/ based on operating system
  2. Build python application by running command below:
docker run -p 5000:5000 in28min/hello-world-python:0.0.1.RELEASE

3. If it fails with the following message, means that there was some other process that was using the port

Status: Downloaded newer image for in28min/hello-world-python:0.0.1.RELEASEdocker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:5000: bind: address already in use.ERRO[0036] error waiting for container: context canceled

To check this running port process, can run command below:

lsof -i:5000

Solved:

You have to kill the process if exists, such as:

kill 78812

In my case, I’m using mac os, there’s have an existing setting (AirPlay Receiver) is bind to 5000 port, can go

System Preferences -> Sharing -> uncheck AirPlay Receiver

4. After clear all existing running port (5000), we have to remove the created container, by running:

docker rm -f in28min/hello-world-python:0.0.1.RELEASE

5. Rerun it:

docker run -p 5000:5000 in28min/hello-world-nodejs:0.0.1.RELEASE

DONE !!

--

--