#Project Structure and Docker configuration
- This links to the Ubuntu Linux distro, choose yours
- Test the installation by getting the version (should be Docker version 19.03.2 or latest):
sudo docker -v
- Make sure everything is fine by downloading the hello-world image from docker hub and running it:
sudo docker run hello-world
- OPTIONAL: If you don't want to type 'sudo' everytime you write a command (trust me you don't) do this. Again, this is for Linux, pick your own OS.
- tl;dr: If you're on linux:
docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- tl;dr: If you're on macOS, I think compose comes natively with docker so check it on the next step
- Test the installation (should be 1.24.1 or latest):
docker-compose --version
##Run the code on docker
- Things should already be configured so here are the main steps and commands you should know:
- To run the code, you must be on the root project folder, in the same level as the docker-compose.yaml file. Run:
docker-compose up
- This builds our custom image and runs it on port 1000. localhost:1000 gets you there.
- To check all you images:
docker images
- To check all you running containers:
docker ps
- To check all running and dead containers:
docker container ls -a
- To remove all your dead containers:
docker container prune
- To remove all your unused images:
docker image prune
- To remove absolutely everything and start fresh:
docker system prune