Docker has test images to test the operation of containers:
httpbin is one of them, it brings testing endpoints.
you can run httpbin, which has /ip and /user-agent endpoints via GET.
list all images:
sudo docker images -a
list all containers:
sudo docker ps -a
The command sudo docker start e8f0fb6e6093 starts the container with the ID e8f0fb6e6093
download httpbin:
docker pull kennethreitz/httpbin
run httpbin:
sudo docker run -p 8080:80 kennethreitz/httpbin
you are supposed to have 2 computers, a server and another one with ssh access.
but with the -d option of docker it runs in the background and you can use it on the same PC.
So:
docker run -d -p 8080:80 kennethreitz/httpbin
then you can do:
curl localhost:8080/user-agent
curl localhost:8080/ip
The httpbin Docker image by default listens on port 80, which is the standard port for HTTP. By mapping port 8080 on your host to port 80 on the httpbin container, you can access httpbin on port 8080.
Here are some details about the httpbin Docker image:
- Base image: python:3.9-slim
- OS: Debian 11 (Bullseye)
- Architecture: AMD64 (x86-64)
- Size: approximately 140 MB
The httpbin Docker image is based on Debian 11 and uses Python 3.9 as the interpreter. The image is lightweight and minimalistic, making it ideal for running the httpbin web server in a container environment.