This repository is to aid the learning of Docker containers. Provides commands, tips and hints, Dockerfiles and docker-compose files.
Enjoy!
- To check for all containers
docker ps
- To check for all containers alive
docker ps -a
- To remove a docker image(s)
docker rmi <image_id1> <image_id2>
- To build an image
docker build -t <desired_image_name> .
- Check the images created
docker images
- Execute the container you just created the image of
docker run -d --name <image> -e <environment-variables=...> -p <port host:port container> <container-name>
- To see the logs of a container
docker logs <image_id>
Run container postgresql:
docker run -d --name postgres_container -e POSTGRES_PASSWORD=mypassword -p 5433:5432 postgresql_container