Docker information
Updating Docker Compose images:
sudo docker compose downsudo docker compose pullsudo docker compose up -dIf you forget-dthen you cannot run Docker detached which causes you not being able to logout. Just don“t forget-d.
Updating Docker image with the Docker CLI
docker pull IMAGENAME:TAGdocker stop CONTAINER-NAMEdocker rm CONTAINER-NAMEdocker run -d --restart=always -p PORT:PORT -v path/to/app/data -name CONTAINER-NAME IMAGE
When inspecting the Docker run command you notice similarities with a Docker Compose file:
- -d -> detached mode
- --restart=always -> Tells Docker to always start the container
- -p -> stands for the ports needs to be used externally and internally
- -v -> this stands for volume to set Docker volumes
- -name -> is the name of the servive
- IMAGE -> this is the last part where you define which image you are going to use